This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fixinc solaris_socket hack


Meeting delayed, so I had just enough time.
This is a better fix aesthetically + it actually works.  Tested.
By the way, I think some of the whitespace differences in the
base test results may be because there have been some cr/lf
patches that snuck in.  It's failing for me now, too.

$ cvs diff inclhack.def
Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.156
diff -u -p -r1.156 inclhack.def
--- inclhack.def        22 May 2003 17:03:57 -0000      1.156
+++ inclhack.def        26 May 2003 20:20:06 -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 +2233,7 @@ fix = {

     test_text = "#if\tdefined(__cplusplus) && (__cplusplus < 54321L)";
 };
+

 /*
  * <widec.h> until Solaris 2.5.1 defines macros for a couple of <wchar.h>
--- sys/socket.h        2003-05-26 13:27:41.000000000 -0700
+++ /home/gnu/gcc.main/gcc/fixinc/tests/base/sys/socket.h       2003-02-19 08:39:05.000000000 -0800
@@ -17,10 +17,3 @@
 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 */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]