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.
Eric Botcazou wrote:
+/* Solaris 2.5.1 and 2.6 use an outdated prototype for recv in sys/socket.h.
+ * This is corrected in Solaris 7 and up.
+ */
+fix = {
+ hackname = solaris_socket_1;
+ 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 recv(int, void *, int, int);";
+ c_fix_arg = '^extern int recv\(int, char \*, int, int);.*';
Your're deleting everything after the semicolon on this line to no
particular purpose. Please just remove the ".*" at the end of the
pattern. Anyway, see below.
+ test_text = '#ident "@(#)socket.h 1.30 97/01/20 SMI"'"\n"
+ "extern int recv(int, char *, int, int);";
+};
Since the send fix is on the same file and essentially the same,
I would like to see them combined (confession: I have a meeting
in a few minutes, so I won't test this for a few days....):
/*
* 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 = '%1 %3void %4';
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);";
};
+/*
+ * 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\(.*\);.*';
As above, the trailing ".*" serves no purpose.
+ test_text = '#ident "@(#)unistd.h 1.33 95/08/28 SMI"'"\n"
+ "extern pid_t getpgid(pid_t);\n"
+ "extern int getpgid();";
+};