diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2003-05-28 11:53:34 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2003-05-28 11:53:34 +0000 |
commit | 6bf1ffe18c117c9c83f1fe2b38c6df0532a8f57c (patch) | |
tree | 0e89929148cc8d0813e05fdc887aba4ca4e96adc /gcc | |
parent | 7101ac35a4df7df770771b32c44a4f569fb88e01 (diff) | |
download | gcc-6bf1ffe18c117c9c83f1fe2b38c6df0532a8f57c.zip gcc-6bf1ffe18c117c9c83f1fe2b38c6df0532a8f57c.tar.gz gcc-6bf1ffe18c117c9c83f1fe2b38c6df0532a8f57c.tar.bz2 |
inclhack.def: Add missing declaration of getpagesize() to unistd.h on Solaris 2.5.1.
* fixinc/inclhack.def: Add missing declaration of getpagesize()
to unistd.h on Solaris 2.5.1.
Fix prototype of recv() and send() in sys/socket.h on
Solaris 2.5.1 and 2.6.
* fixinc/tests/base/unistd.h: Add solaris_unistd fix test.
* fixinc/tests/base/sys/socket.h: Add solaris_socket test.
* fixinc/check.tpl: Use 'diff -c', not 'diff -u'.
* fixinc/fixincl.x: Regenerate.
From-SVN: r67206
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/fixinc/check.tpl | 2 | ||||
-rw-r--r-- | gcc/fixinc/fixincl.x | 102 | ||||
-rw-r--r-- | gcc/fixinc/inclhack.def | 39 | ||||
-rw-r--r-- | gcc/fixinc/tests/base/sys/socket.h | 7 | ||||
-rw-r--r-- | gcc/fixinc/tests/base/unistd.h | 9 |
6 files changed, 167 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 08805e7..f8d9e79 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2003-05-28 Eric Botcazou <ebotcazou@libertysurf.fr> + Bruce Korb <bkorb@gnu.org> + Arno Klaassen <arno@heho.snv.jussieu.fr> + + * fixinc/inclhack.def: Add missing declaration of getpagesize() + to unistd.h on Solaris 2.5.1. + Fix prototype of recv() and send() in sys/socket.h on + Solaris 2.5.1 and 2.6. + * fixinc/tests/base/unistd.h: Add solaris_unistd fix test. + * fixinc/tests/base/sys/socket.h: Add solaris_socket test. + * fixinc/check.tpl: Use 'diff -c', not 'diff -u'. + * fixinc/fixincl.x: Regenerate. + 2003-05-27 Jason Merrill <jason@redhat.com> * tree.c (expr_first, expr_length): New fns. @@ -6,7 +19,7 @@ * tree.c (iterative_hash_expr): Hash commutative expressions consistently. -2003-05027 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> +2003-05-27 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * tree.h (contains_placeholder_p): Now returns bool. (CONTAINS_PLACEHOLDER_P): New macro. diff --git a/gcc/fixinc/check.tpl b/gcc/fixinc/check.tpl index 3401cf8..9f8750b 100644 --- a/gcc/fixinc/check.tpl +++ b/gcc/fixinc/check.tpl @@ -135,7 +135,7 @@ do : else - ${DIFF:-diff} -u $f ${TESTBASE}/$f >&2 || : + ${DIFF:-diff} -c $f ${TESTBASE}/$f >&2 || : exitok=false fi done diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x index 84239e7..20f13c8 100644 --- a/gcc/fixinc/fixincl.x +++ b/gcc/fixinc/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Thursday May 22, 2003 at 10:03:21 AM PDT + * It has been AutoGen-ed Wednesday May 28, 2003 at 12:55:57 AM CDT * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Thu May 22 10:03:21 PDT 2003 +/* DO NOT CVS-MERGE THIS FILE, EITHER Wed May 28 00:55:57 CDT 2003 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 152 fixup descriptions. + * This file contains 154 fixup descriptions. * * See README for more information. * @@ -3967,6 +3967,42 @@ static const char* apzSolaris_Mutex_Init_2Patch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Solaris_Socket fix + */ +tSCC zSolaris_SocketName[] = + "solaris_socket"; + +/* + * File name selection pattern + */ +tSCC zSolaris_SocketList[] = + "|sys/socket.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_SocketMachs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_SocketSelect0[] = + "@\\(#\\)socket.h[ \t]+1.[123][0-9][ \t]+9[567]/[0-9/]+ SMI"; + +#define SOLARIS_SOCKET_TEST_CT 1 +static tTestDesc aSolaris_SocketTests[] = { + { TT_EGREP, zSolaris_SocketSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Socket + */ +static const char* apzSolaris_SocketPatch[] = { + "format", + "extern int %1(int, %2void *, int, int);", + "^extern int (recv|send)\\(int, (const )*char \\*, int, int\\);", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Solaris_Stdio_Tag fix */ tSCC zSolaris_Stdio_TagName[] = @@ -4001,6 +4037,50 @@ static const char* apzSolaris_Stdio_TagPatch[] = { "sed", /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Solaris_Unistd fix + */ +tSCC zSolaris_UnistdName[] = + "solaris_unistd"; + +/* + * File name selection pattern + */ +tSCC zSolaris_UnistdList[] = + "|unistd.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_UnistdMachs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_UnistdSelect0[] = + "@\\(#\\)unistd.h[ \t]+1.3[0-9][ \t]+9[567]/[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_UnistdBypass0[] = + "getpagesize"; + +#define SOLARIS_UNISTD_TEST_CT 2 +static tTestDesc aSolaris_UnistdTests[] = { + { TT_NEGREP, zSolaris_UnistdBypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_UnistdSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Unistd + */ +static const char* apzSolaris_UnistdPatch[] = { + "format", + "extern int getpagesize();\n\ +%0", + "^extern (pid_t|int) getpgid\\(.*\\);", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Solaris_Widec fix */ tSCC zSolaris_WidecName[] = @@ -6018,9 +6098,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 168 +#define REGEX_COUNT 171 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 152 +#define FIX_COUNT 154 /* * Enumerate the fixes @@ -6124,7 +6204,9 @@ typedef enum { SCO_UTIME_FIXIDX, SOLARIS_MUTEX_INIT_1_FIXIDX, SOLARIS_MUTEX_INIT_2_FIXIDX, + SOLARIS_SOCKET_FIXIDX, SOLARIS_STDIO_TAG_FIXIDX, + SOLARIS_UNISTD_FIXIDX, SOLARIS_WIDEC_FIXIDX, STATSSWTCH_FIXIDX, STDIO_STDARG_H_FIXIDX, @@ -6671,11 +6753,21 @@ tFixDesc fixDescList[ FIX_COUNT ] = { SOLARIS_MUTEX_INIT_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aSolaris_Mutex_Init_2Tests, apzSolaris_Mutex_Init_2Patch, 0 }, + { zSolaris_SocketName, zSolaris_SocketList, + apzSolaris_SocketMachs, + SOLARIS_SOCKET_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_SocketTests, apzSolaris_SocketPatch, 0 }, + { zSolaris_Stdio_TagName, zSolaris_Stdio_TagList, apzSolaris_Stdio_TagMachs, SOLARIS_STDIO_TAG_TEST_CT, FD_MACH_ONLY, aSolaris_Stdio_TagTests, apzSolaris_Stdio_TagPatch, 0 }, + { zSolaris_UnistdName, zSolaris_UnistdList, + apzSolaris_UnistdMachs, + SOLARIS_UNISTD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_UnistdTests, apzSolaris_UnistdPatch, 0 }, + { zSolaris_WidecName, zSolaris_WidecList, apzSolaris_WidecMachs, SOLARIS_WIDEC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index f3ce2c3..b43b215 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -2200,6 +2200,26 @@ fix = { /* + * Solaris 2.5.1 and 2.6 use an outdated prototype for send & recv + * in sys/socket.h. This is corrected in Solaris 7 and up. + */ +fix = { + hackname = solaris_socket; + files = sys/socket.h; + select = '@\(#\)socket.h' "[ \t]+1.[123][0-9][ \t]+9[567]/[0-9/]+ SMI"; + c_fix = format; + c_fix_arg = "extern int %1(int, %2void *, int, int);"; + c_fix_arg = '^extern int (recv|send)\(int,' + ' (const )*char ' + '\*, int, int\);'; + + test_text = '#ident "@(#)socket.h 1.30 97/01/20 SMI"'"\n" + "extern int recv(int, char *, int, int);\n" + "extern int send(int, const char *, int, int);"; +}; + + +/* * Solaris 2.8 has what appears to be some gross workaround for * some old version of their c++ compiler. G++ doesn't want it * either, but doesn't want to be tied to SunPRO version numbers. @@ -2214,6 +2234,25 @@ fix = { test_text = "#if\tdefined(__cplusplus) && (__cplusplus < 54321L)"; }; + +/* + * Sun Solaris 2.5.1 doesn't define 'getpagesize' in <unistd.h>, as is done + * on Solaris 2.6 and up. + */ +fix = { + hackname = solaris_unistd; + files = unistd.h; + select = '@\(#\)unistd.h' "[ \t]+1.3[0-9][ \t]+9[567]/[0-9/]+ SMI"; + bypass = "getpagesize"; + c_fix = format; + c_fix_arg = "extern int getpagesize();\n%0"; + c_fix_arg = '^extern (pid_t|int) getpgid\(.*\);'; + test_text = '#ident "@(#)unistd.h 1.33 95/08/28 SMI"'"\n" + "extern pid_t getpgid(pid_t);\n" + "extern int getpgid();"; +}; + + /* * <widec.h> until Solaris 2.5.1 defines macros for a couple of <wchar.h> * functions, breaking their prototypes if that file is included afterwards. diff --git a/gcc/fixinc/tests/base/sys/socket.h b/gcc/fixinc/tests/base/sys/socket.h index 56099a9..0898ed0 100644 --- a/gcc/fixinc/tests/base/sys/socket.h +++ b/gcc/fixinc/tests/base/sys/socket.h @@ -17,3 +17,10 @@ typedef int socklen_t; typedef u_int32_t socklen_t; #endif /* _NO_XOPEN4 && _NO_XOPEN5 */ #endif /* IRIX_SOCKLEN_T_CHECK */ + + +#if defined( SOLARIS_SOCKET_CHECK ) +#ident "@(#)socket.h 1.30 97/01/20 SMI" +extern int recv(int, void *, int, int); +extern int send(int, const void *, int, int); +#endif /* SOLARIS_SOCKET_CHECK */ diff --git a/gcc/fixinc/tests/base/unistd.h b/gcc/fixinc/tests/base/unistd.h index 756451d..5bfb9b9 100644 --- a/gcc/fixinc/tests/base/unistd.h +++ b/gcc/fixinc/tests/base/unistd.h @@ -12,3 +12,12 @@ #if defined( ALPHA_SBRK_CHECK ) extern void *sbrk(ptrdiff_t increment); #endif /* ALPHA_SBRK_CHECK */ + + +#if defined( SOLARIS_UNISTD_CHECK ) +#ident "@(#)unistd.h 1.33 95/08/28 SMI" +extern int getpagesize(); +extern pid_t getpgid(pid_t); +extern int getpagesize(); +extern int getpgid(); +#endif /* SOLARIS_UNISTD_CHECK */ |