aboutsummaryrefslogtreecommitdiff
path: root/fixincludes
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-03-15 17:37:03 +0000
committerJoseph Myers <joseph@codesourcery.com>2005-03-15 17:37:03 +0000
commit8cbf16346dcf4851bdd1c818b47d4058e6298dbc (patch)
tree050ea251e9929f1104cc81881e7449a67339c760 /fixincludes
parent03b505937b84ad97c908b196298c692bb99d7b1e (diff)
* inclhack.def (hpux_htonl): New fix.
* tests/base/netinet/in.h: New test. * fixincl.x: Regenerate. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@96522 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes')
-rw-r--r--fixincludes/ChangeLog6
-rw-r--r--fixincludes/fixincl.x56
-rw-r--r--fixincludes/inclhack.def28
-rw-r--r--fixincludes/tests/base/netinet/in.h24
4 files changed, 109 insertions, 5 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 03b55917f10..cde72ca6e85 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-15 Joseph S. Myers <joseph@codesourcery.com>
+
+ * inclhack.def (hpux_htonl): New fix.
+ * tests/base/netinet/in.h: New test.
+ * fixincl.x: Regenerate.
+
2005-02-23 James E Wilson <wilson@specifixinc.com>
* Makefile.in (full-stamp, test-stamp, $(AF)): Add $(CFLAGS) to link.
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 2eabf1f572e..4c790e7059e 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Friday November 26, 2004 at 09:59:26 PM UTC
+ * It has been AutoGen-ed Monday March 14, 2005 at 09:43:34 PM UTC
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Nov 26 21:59:26 UTC 2004
+/* DO NOT CVS-MERGE THIS FILE, EITHER Mon Mar 14 21:43:34 UTC 2005
*
* 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 177 fixup descriptions.
+ * This file contains 178 fixup descriptions.
*
* See README for more information.
*
@@ -2648,6 +2648,46 @@ static const char* apzHpux_Ctype_MacrosPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Hpux_Htonl fix
+ */
+tSCC zHpux_HtonlName[] =
+ "hpux_htonl";
+
+/*
+ * File name selection pattern
+ */
+tSCC zHpux_HtonlList[] =
+ "|netinet/in.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzHpux_HtonlMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zHpux_HtonlSelect0[] =
+ "#ifndef _XOPEN_SOURCE_EXTENDED\n\
+(/\\*\n\
+ \\* Macros for number representation conversion\\.\n\
+ \\*/\n\
+#ifndef ntohl)";
+
+#define HPUX_HTONL_TEST_CT 1
+static tTestDesc aHpux_HtonlTests[] = {
+ { TT_EGREP, zHpux_HtonlSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Hpux_Htonl
+ */
+static const char* apzHpux_HtonlPatch[] = {
+ "format",
+ "#if 1\n\
+%1",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Hpux_Long_Double fix
*/
tSCC zHpux_Long_DoubleName[] =
@@ -7085,9 +7125,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 207
+#define REGEX_COUNT 208
#define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT 177
+#define FIX_COUNT 178
/*
* Enumerate the fixes
@@ -7156,6 +7196,7 @@ typedef enum {
HPUX11_VSNPRINTF_FIXIDX,
HPUX8_BOGUS_INLINES_FIXIDX,
HPUX_CTYPE_MACROS_FIXIDX,
+ HPUX_HTONL_FIXIDX,
HPUX_LONG_DOUBLE_FIXIDX,
HPUX_SYSTIME_FIXIDX,
INT_ABORT_FREE_AND_EXIT_FIXIDX,
@@ -7588,6 +7629,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
HPUX_CTYPE_MACROS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHpux_Ctype_MacrosTests, apzHpux_Ctype_MacrosPatch, 0 },
+ { zHpux_HtonlName, zHpux_HtonlList,
+ apzHpux_HtonlMachs,
+ HPUX_HTONL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHpux_HtonlTests, apzHpux_HtonlPatch, 0 },
+
{ zHpux_Long_DoubleName, zHpux_Long_DoubleList,
apzHpux_Long_DoubleMachs,
HPUX_LONG_DOUBLE_TEST_CT, FD_MACH_ONLY,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 28dbd46533e..7bd48dba1ba 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -1507,6 +1507,34 @@ fix = {
/*
+ * Fix hpux broken #ifndef _XOPEN_SOURCE_EXTENDED conditional on htonl etc.
+ */
+fix = {
+ hackname = hpux_htonl;
+ files = netinet/in.h;
+ select = "#ifndef _XOPEN_SOURCE_EXTENDED\n"
+ "(/\\*\n"
+ " \\* Macros for number representation conversion\\.\n"
+ " \\*/\n"
+ "#ifndef ntohl)";
+ c_fix = format;
+ c_fix_arg = "#if 1\n%1";
+
+ test_text = "#ifndef _XOPEN_SOURCE_EXTENDED\n"
+ "/*\n"
+ " * Macros for number representation conversion.\n"
+ " */\n"
+ "#ifndef ntohl\n"
+ "#define ntohl(x) (x)\n"
+ "#define ntohs(x) (x)\n"
+ "#define htonl(x) (x)\n"
+ "#define htons(x) (x)\n"
+ "#endif\n"
+ "#endif /* ! _XOPEN_SOURCE_EXTENDED */";
+};
+
+
+/*
* HP-UX long_double
*/
fix = {
diff --git a/fixincludes/tests/base/netinet/in.h b/fixincludes/tests/base/netinet/in.h
new file mode 100644
index 00000000000..2d7f7b8522f
--- /dev/null
+++ b/fixincludes/tests/base/netinet/in.h
@@ -0,0 +1,24 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/netinet/in.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( HPUX_HTONL_CHECK )
+#if 1
+/*
+ * Macros for number representation conversion.
+ */
+#ifndef ntohl
+#define ntohl(x) (x)
+#define ntohs(x) (x)
+#define htonl(x) (x)
+#define htons(x) (x)
+#endif
+#endif /* ! _XOPEN_SOURCE_EXTENDED */
+#endif /* HPUX_HTONL_CHECK */