This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fixinc for Solaris 2.5.1
> Minor complaints aside, it looks fine to me.
Ok for this version after bootstrapping?
--
Eric Botcazou
2003-05-27 Eric Botcazou <ebotcazou@libertysurf.fr>
Bruce Korb <bkorb@veritas.com>
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'.
Index: fixinc/check.tpl
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/check.tpl,v
retrieving revision 1.18
diff -u -r1.18 check.tpl
--- fixinc/check.tpl 19 Apr 2003 21:10:07 -0000 1.18
+++ fixinc/check.tpl 26 May 2003 10:52:04 -0000
@@ -135,7 +135,7 @@
:
else
- ${DIFF:-diff} -u $f ${TESTBASE}/$f >&2 || :
+ ${DIFF:-diff} -c $f ${TESTBASE}/$f >&2 || :
exitok=false
fi
done
Index: fixinc/inclhack.def
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.156
diff -u -r1.156 inclhack.def
--- fixinc/inclhack.def 22 May 2003 17:03:57 -0000 1.156
+++ fixinc/inclhack.def 26 May 2003 10:52:08 -0000
@@ -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.
@@ -2213,6 +2243,25 @@
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>
Index: fixinc/tests/base/unistd.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/tests/base/unistd.h,v
retrieving revision 1.2
diff -u -r1.2 unistd.h
--- fixinc/tests/base/unistd.h 19 Jul 2000 14:18:30 -0000 1.2
+++ fixinc/tests/base/unistd.h 26 May 2003 10:52:08 -0000
@@ -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 */
Index: fixinc/tests/base/sys/socket.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/tests/base/sys/socket.h,v
retrieving revision 1.1
diff -u -r1.1 socket.h
--- fixinc/tests/base/sys/socket.h 19 Feb 2003 16:39:05 -0000 1.1
+++ fixinc/tests/base/sys/socket.h 26 May 2003 10:52:08 -0000
@@ -17,3 +17,10 @@
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 */