This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: HP-UX header file fixup.
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 4 May 2006 10:05:54 -0700 (PDT)
- Subject: Patch: HP-UX header file fixup.
- Reply-to: sje at cup dot hp dot com
When compiling programs on HP-UX 11.23 platforms with
-D_FILE_OFFSET_BITS=64 the /usr/include/sys/socket.h header file will
declare sendfile and sendpath as extern and then as static. The HP
compiler gives a warning on this but GCC gives a hard error. This
header file patch is to hide the extern declaration when we want the
static one.
I would like to check this in on the main line and on the 4.1 branch,
tested on IA64 and PA HP-UX targets.
Ok for checkin?
2006-05-04 Steve Ellcey <sje@cup.hp.com>
* fixincludes/inclhack.def (hpux11_extern_sendfile): New fixup.
(hpux11_extern_sendfile): New fixup.
* fixincludes/fixincl.x: Regenerate.
Index: inclhack.def
===================================================================
--- inclhack.def (revision 113358)
+++ inclhack.def (working copy)
@@ -1716,6 +1716,26 @@ fix = {
test_text = "extern union mpinfou spu_info[];";
};
+fix = {
+ hackname = hpux11_extern_sendfile;
+ mach = *-hp-hpux11*;
+ files = sys/socket.h;
+ select = "^[ \t]*extern sbsize_t sendfile.*\n.*, int\\)\\);\n";
+ c_fix = format;
+ c_fix_arg = "#ifndef _APP32_64BIT_OFF_T\n%0#endif\n";
+ test_text = " extern sbsize_t sendfile __((int, int, off_t, bsize_t,\n const struct iovec *, int));\n";
+};
+
+fix = {
+ hackname = hpux11_extern_sendpath;
+ mach = *-hp-hpux11*;
+ files = sys/socket.h;
+ select = "^[ \t]*extern sbsize_t sendpath.*\n.*, int\\)\\);\n";
+ c_fix = format;
+ c_fix_arg = "#ifndef _APP32_64BIT_OFF_T\n%0#endif\n";
+ test_text = " extern sbsize_t sendpath __((int, int, off_t, bsize_t,\n const struct iovec *, int));\n";
+};
+
/*
* Fix glibc definition of HUGE_VAL in terms of hex floating point constant