replace "extern" only if surrounded by space characters.
authorBruce Korb <bkorb@gnu.org>
Sun, 4 Feb 2007 15:10:08 +0000 (15:10 +0000)
committerBruce Korb <korbb@gcc.gnu.org>
Sun, 4 Feb 2007 15:10:08 +0000 (15:10 +0000)
From-SVN: r121574

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/sys/sysmacros.h

index 0149f62a2e0d1c7ee1e9b8373146cd0b5d62dbfb..b8c37a5e7563846edf0009880c235be497fd9509 100644 (file)
@@ -1,3 +1,8 @@
+2007-02-03  Bruce Korb <bkorb@gnu.org>
+
+       * inclhack.def (glibc_c99_inline_4): replace "extern" only if
+       surrounded by space characters.
+
 2007-01-25  Daniel Franke <franke.daniel@gmail.com>
 
        PR target/30272
index 795b852d6d76b1bd02c971d53f4d833cd153dc6d..f97bdb63d8577c7309fa8bc66e2a65a51e5748b3 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Monday January 15, 2007 at 09:38:13 PM CET
+ * It has been AutoGen-ed  Sunday February  4, 2007 at 07:08:33 AM PST
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Mo Jan 15 21:38:13 CET 2007
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Feb  4 07:08:34 PST 2007
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -2316,15 +2316,22 @@ tSCC zGlibc_C99_Inline_4List[] =
  */
 #define apzGlibc_C99_Inline_4Machs (const char**)NULL
 
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zGlibc_C99_Inline_4Select0[] =
+       " extern ";
+
 /*
  *  content bypass pattern - skip fix if pattern found
  */
 tSCC zGlibc_C99_Inline_4Bypass0[] =
        "__STDC_VERSION__";
 
-#define    GLIBC_C99_INLINE_4_TEST_CT  1
+#define    GLIBC_C99_INLINE_4_TEST_CT  2
 static tTestDesc aGlibc_C99_Inline_4Tests[] = {
-  { TT_NEGREP,   zGlibc_C99_Inline_4Bypass0, (regex_t*)NULL }, };
+  { TT_NEGREP,   zGlibc_C99_Inline_4Bypass0, (regex_t*)NULL },
+  { TT_EGREP,    zGlibc_C99_Inline_4Select0, (regex_t*)NULL }, };
 
 /*
  *  Fix Command Arguments for Glibc_C99_Inline_4
@@ -2335,7 +2342,6 @@ static const char* apzGlibc_C99_Inline_4Patch[] = {
 #if __STDC_VERSION__ < 19901L\n\
 extern\n\
 #endif\n",
-    "extern",
     (char*)NULL };
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -8419,7 +8425,7 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          250
+#define REGEX_COUNT          251
 #define MACH_LIST_SIZE_LIMIT 261
 #define FIX_COUNT            207
 
index 242f5af545f7b634f3f71de62046d0afc947936a..24dc087f93b932292fcf3775774c446323244e22 100644 (file)
@@ -654,7 +654,8 @@ fix = {
  */
 fix = {
     hackname  = alpha___extern_prefix;
-    select    = "(.*)(defined\\(__DECC\\)|def[ \t]*__DECC)[ \t]*\n(#[ \t]*pragma[ \t]*extern_prefix.*)";
+    select    = "(.*)(defined\\(__DECC\\)|def[ \t]*__DECC)[ \t]*\n"
+                "(#[ \t]*pragma[ \t]*extern_prefix.*)";
 
     mach      = "alpha*-dec-osf*";
     c_fix     = format;
@@ -681,7 +682,8 @@ fix = {
     c_fix     = format;
     c_fix_arg = "%0 && !defined(__PRAGMA_EXTERN_PREFIX)";
 
-    test_text = "#if (_ISO_C_SOURCE>=19990L) && !defined(_LIBC_POLLUTION_H_) && !defined(__DECC)";
+    test_text = "#if (_ISO_C_SOURCE>=19990L) "
+                "&& !defined(_LIBC_POLLUTION_H_) && !defined(__DECC)";
 };
 
 
@@ -714,7 +716,8 @@ fix = {
     select    = '(#define assert\(EX\).*)\(\(int\) \(EX\)\)';
     c_fix     = format;
     c_fix_arg = "%1(EX)";
-    test_text = '#define assert(EX) (((int) (EX)) ? (void)0 : __assert(#EX, __FILE__, __LINE__))';
+    test_text = '#define assert(EX) (((int) (EX)) ? (void)0 '
+                ': __assert(#EX, __FILE__, __LINE__))';
 };
 
 
@@ -782,14 +785,17 @@ fix = {
 fix = {
     hackname  = alpha_pthread;
     files     = pthread.h;
-    select    = "((#[ \t]*if)([ \t]*defined[ \t]*\\(_PTHREAD_ENV_DECC\\)|def _PTHREAD_ENV_DECC)(.*))\n"
+    select    = "((#[ \t]*if)([ \t]*defined[ \t]*\\(_PTHREAD_ENV_DECC\\)"
+                "|def _PTHREAD_ENV_DECC)(.*))\n"
                "(#[ \t]*define _PTHREAD_USE_PTDNAM_)";
 
     mach      = "alpha*-dec-osf*";
     c_fix     = format;
-    c_fix_arg = "%2 defined (_PTHREAD_ENV_DECC)%4 || defined (__PRAGMA_EXTERN_PREFIX)\n%5";
+    c_fix_arg = "%2 defined (_PTHREAD_ENV_DECC)%4 "
+                "|| defined (__PRAGMA_EXTERN_PREFIX)\n%5";
 
-    test_text = "#  if defined (_PTHREAD_ENV_DECC) || defined (_PTHREAD_ENV_EPCC)\n"
+    test_text = "#  if defined (_PTHREAD_ENV_DECC) "
+                      "|| defined (_PTHREAD_ENV_EPCC)\n"
                "#   define _PTHREAD_USE_PTDNAM_\n"
                "#  endif\n"
                "#  ifdef _PTHREAD_ENV_DECC\n"
@@ -887,8 +893,12 @@ fix = {
 
     mach     = "alpha*-dec-osf4*";
     select   = "#define wcstok wcstok_r";
-    sed      = "s@#define wcstok wcstok_r@extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__(\"wcstok_r\");@";
-    sed      = "s@#define wcsftime __wcsftime_isoc@extern size_t   wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__(\"__wcsftime_isoc\");@";
+    sed      = "s@#define wcstok wcstok_r@"
+                "extern wchar_t *wcstok __((wchar_t *, const wchar_t *, "
+                          "wchar_t **)) __asm__(\"wcstok_r\");@";
+    sed      = "s@#define wcsftime __wcsftime_isoc@"
+                "extern size_t   wcsftime __((wchar_t *, size_t, const wchar_t *"
+                          ", const struct tm *)) __asm__(\"__wcsftime_isoc\");@";
     test_text = "#define wcstok wcstok_r\n"
                "#define wcsftime __wcsftime_isoc";
 };
@@ -1320,21 +1330,21 @@ fix = {
     hackname  = glibc_c99_inline_2;
     files     = sys/stat.h, '*/sys/stat.h';
     select    = "extern __inline__ int";
-    sed              = "s/extern int \\(stat\\|lstat\\|fstat\\|mknod\\)/"
-               "#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
-               "__inline__ int \\1/";
-    sed              = "s/extern int __REDIRECT\\(_NTH\\|\\) (\\(stat\\|lstat\\|fstat\\)/"
-               "#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
-               "__inline__ int __REDIRECT\\1 (\\2/";
-    sed              = "s/^extern __inline__ int/"
-               "#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
-               "__inline__ int/";
+    sed     = "s/extern int \\(stat\\|lstat\\|fstat\\|mknod\\)/"
+              "#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
+              "__inline__ int \\1/";
+    sed     = "s/extern int __REDIRECT\\(_NTH\\|\\) (\\(stat\\|lstat\\|fstat\\)/"
+              "#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
+              "__inline__ int __REDIRECT\\1 (\\2/";
+    sed     = "s/^extern __inline__ int/"
+              "#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
+              "__inline__ int/";
     test_text = <<-EOT
-extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
-extern __inline__ int
-__NTH (fstat64 (int __fd, struct stat64 *__statbuf))
-{}
-EOT;
+       extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
+       extern __inline__ int
+       __NTH (fstat64 (int __fd, struct stat64 *__statbuf))
+       {}
+       EOT;
 };
 
 
@@ -1346,12 +1356,12 @@ fix = {
     c_fix_arg = "# if defined(__cplusplus) || __STDC_VERSION__ >= 19901L";
     c_fix_arg = "^# ifdef __cplusplus$";
     test_text = <<-EOT
-# ifdef __cplusplus
-#  define __STRING_INLINE inline
-# else
-#  define __STRING_INLINE extern __inline
-# endif
-EOT;
+       # ifdef __cplusplus
+       #  define __STRING_INLINE inline
+       # else
+       #  define __STRING_INLINE extern __inline
+       # endif
+       EOT;
 };
 
 
@@ -1359,12 +1369,13 @@ fix = {
     hackname  = glibc_c99_inline_4;
     files     = sys/sysmacros.h, '*/sys/sysmacros.h';
     bypass    = "__STDC_VERSION__";
+    select    = ' extern ';
     c_fix     = format;
     c_fix_arg = "\n#if __STDC_VERSION__ < 19901L\nextern\n#endif\n";
-    c_fix_arg = "extern";
     test_text = <<-EOT
-__extension__ extern __inline unsigned int
-EOT;
+       __extension__ extern __inline unsigned int
+       __extension__ __extern_inline unsigned int
+       EOT;
 };
 
 
index 6891a67500694bfad4da1111ec990ac77f111af2..40c44f6183e616f0b1f5204c93a40bfd42cb421e 100644 (file)
 
 
 #if defined( GLIBC_C99_INLINE_4_CHECK )
-__extension__ 
+__extension__
 #if __STDC_VERSION__ < 19901L
 extern
 #endif
- __inline unsigned int
+__inline unsigned int
+__extension__ __extern_inline unsigned int
 #endif  /* GLIBC_C99_INLINE_4_CHECK */