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]

[committed] Fix errno definition on HP-UX (put in extern "C")


I have checked in the following HP-UX change to deal with the fact that
errno on HP-UX is declared in two different headers, one inside 'extern
"C"' and one outside.  C++ used to not complain about this, but now it
does due to the patch for PR 27227.

This patch puts the /usr/include/errno.h declaration of errno inside an
'extern "C".  This header file bug is fixed in HP-UX 11.31 (not yet
released), so I restricted the header file fix to HP-UX 10.* and 11.[12]
versions.

2006-06-23  Steve Ellcey  <sje@cup.hp.com>

	PR target/28084
	* inclhack.def (hpux_extern_errno): New.
	* fixincl.x: Regenerate.

Index: inclhack.def
===================================================================
--- inclhack.def	(revision 114920)
+++ inclhack.def	(working copy)
@@ -1716,6 +1716,17 @@ fix = {
     test_text = "extern union mpinfou spu_info[];";
 };
 
+fix = {
+    hackname  = hpux_extern_errno;
+    mach      = "*-hp-hpux10.*";
+    mach      = "*-hp-hpux11.[0-2]*";
+    files     = errno.h;
+    select    = "^[ \t]*extern int errno;$";
+    c_fix     = format;
+    c_fix_arg = "#ifdef __cplusplus\nextern \"C\" {\n#endif\n%0\n#ifdef __cplusplus\n}\n#endif";
+    test_text = "   extern int errno;\n";
+};
+
 
 /*
  *  Fix glibc definition of HUGE_VAL in terms of hex floating point constant


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