From ec92da4adc26937723aa01278c1892006c9726b6 Mon Sep 17 00:00:00 2001
From: rus <rus@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 12 Mar 2009 18:21:20 +0000
Subject: Merge with trunk at revision 144820

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/profile-stdlib@144821 138bc75d-0d04-0410-961f-82ee72b054a4
---
 fixincludes/inclhack.def | 73 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 72 insertions(+), 1 deletion(-)

(limited to 'fixincludes/inclhack.def')

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 69ea0cf59a8..4a5af1df609 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -562,6 +562,19 @@ fix = {
 };
 
 
+/*
+ *  Fix missing semicolon on Alpha OSF/4 in <net/if.h>
+ */
+fix = {
+    hackname  = alpha_if_semicolon;
+    files     = net/if.h;
+    select    = "struct[ \t]+sockaddr[ \t]+vmif_paddr[ \t]+/\\*";
+    c_fix     = format;
+    c_fix_arg = "struct sockaddr vmif_paddr;\t/*";
+    test_text = '     struct  sockaddr vmif_paddr     /* protocol address */';
+};
+
+
 /*
  * Remove erroneous parentheses in sym.h on Alpha OSF/1.
  */
@@ -1756,7 +1769,14 @@ fix = {
 fix = {
     hackname = hpux_spu_info;
     mach     = "*-hp-hpux*";
-    files    = ia64/sys/getppdp.h;
+    /*
+     *  It is tempting to omit the first "files" entry.  Do not.
+     *  The testing machinery will take the first "files" entry as the name
+     *  of a test file to play with.  It would be a nuisance to have a directory
+     *  with the name "*".
+     */
+    files    = "ia64/sys/getppdp.h";
+    files    = "*/sys/getppdp.h";
     select   = "^.*extern.*spu_info.*";
 
     c_fix     = format;
@@ -2516,6 +2536,44 @@ fix = {
     test_text = "char *na_addr\t";
 };
 
+/* 
+ * Fix OpenBSD's NULL definition.
+ */
+fix = {
+  hackname  = openbsd_null_definition;
+  mach      = "*-*-openbsd*";
+  files     = locale.h, stddef.h, stdio.h, string.h,
+  time.h, unistd.h, wchar.h, sys/param.h;
+  select    = "__GNUG__";
+  c_fix = format;
+  c_fix_arg = "#ifndef NULL\n"
+	      "#ifdef __cplusplus\n"
+	      "#ifdef __GNUG__\n"
+	      "#define NULL\t__null\n"
+	      "#else\t /* ! __GNUG__  */\n"
+	      "#define NULL\t0L\n"
+              "#endif\t /* __GNUG__  */\n"
+	      "#else\t /* ! __cplusplus  */\n"
+	      "#define NULL\t((void *)0)\n"
+              "#endif\t /* __cplusplus  */\n"
+              "#endif\t /* !NULL  */";
+
+  c_fix_arg = "^#ifndef[ \t]*NULL\n"
+	      "^#ifdef[ \t]*__GNUG__\n"
+  	      "^#define[ \t]*NULL[ \t]*__null\n"
+  	      "^#else\n"
+              "^#define[ \t]*NULL[ \t]*0L\n"
+              "^#endif\n"
+              "^#endif";
+  test_text = 
+	"#ifndef NULL\n"
+	"#ifdef  __GNUG__\n"
+	"#define NULL    __null\n"
+	"#else\n"
+	"#define NULL    0L\n"
+	"#endif\n"
+	"#endif\n";
+};
 
 /*
  *  obstack.h used casts as lvalues.
@@ -2541,6 +2599,19 @@ fix = {
     test_text = "*((void **) (h)->next_free)++ = (aptr)";
 };
 
+/* 
+ * Fix OpenBSD's va_start define.
+ */
+fix = {
+  hackname  = openbsd_va_start;
+  mach      = "*-*-openbsd*";
+  files     = stdarg.h;
+  select    = '__builtin_stdarg_start';
+  c_fix     = format;
+  c_fix_arg = __builtin_va_start;
+
+  test_text = "#define va_start(v,l)   __builtin_stdarg_start((v),l)";
+};
 
 /*
  *  sys/lc_core.h on some versions of OSF1/4.x pollutes the namespace by
-- 
cgit v1.2.1

