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]

[PATCH] Fix predefine problem on PA under hpux


The following patch fixes a regression that I introduced when I added
the TARGET_OS_CPP_BUILTINS macro define.  I tried to duplicate as closely
as possible the defines used by the HP compilers.  However, it turns out
that GCC defines __STDC__ and the HP C++ compilers don't.  The workaround
is to define __STDC_EXT__.  This is needed in both ISO and non-ISO modes.

Tested on hppa64-hp-hpux11.11.  Installed to 3.4.  Will install to 3.3.2
after the 3.3.1 release.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2003-08-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	PR c++/11712
	* pa-hpux.h, pa-hpux10.h, pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define
	__STDC_EXT__ when using C++ dialect.

Index: config/pa/pa-hpux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 pa-hpux.h
--- config/pa/pa-hpux.h	1 Jul 2003 05:45:18 -0000	1.9
+++ config/pa/pa-hpux.h	7 Aug 2003 22:05:40 -0000
@@ -28,6 +28,12 @@ Boston, MA 02111-1307, USA.  */
 #define SIZE_TYPE "unsigned int"
 #define PTRDIFF_TYPE "int"
 
+/* GCC always defines __STDC__.  HP C++ compilers don't define it.  This
+   causes trouble when sys/stdsyms.h is included.  As a work around,
+   we define __STDC_EXT__.  A similar situation exists with respect to
+   the definition of __cplusplus.  We define _INCLUDE_LONGLONG
+   to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
+   support).  */
 #undef TARGET_OS_CPP_BUILTINS
 #define TARGET_OS_CPP_BUILTINS()				\
   do								\
@@ -46,6 +52,7 @@ Boston, MA 02111-1307, USA.  */
 	  {							\
 	    builtin_define ("_HPUX_SOURCE");			\
 	    builtin_define ("_INCLUDE_LONGLONG");		\
+	    builtin_define ("__STDC_EXT__");			\
 	  }							\
 	else if (!flag_iso)					\
 	  {							\
Index: config/pa/pa-hpux10.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux10.h,v
retrieving revision 1.16
diff -u -3 -p -r1.16 pa-hpux10.h
--- config/pa/pa-hpux10.h	1 Jul 2003 05:45:18 -0000	1.16
+++ config/pa/pa-hpux10.h	7 Aug 2003 22:05:40 -0000
@@ -20,6 +20,12 @@ along with GNU CC; see the file COPYING.
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+/* GCC always defines __STDC__.  HP C++ compilers don't define it.  This
+   causes trouble when sys/stdsyms.h is included.  As a work around,
+   we define __STDC_EXT__.  A similar situation exists with respect to
+   the definition of __cplusplus.  We define _INCLUDE_LONGLONG
+   to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
+   support).  */
 #undef TARGET_OS_CPP_BUILTINS
 #define TARGET_OS_CPP_BUILTINS()				\
   do								\
@@ -36,6 +42,7 @@ Boston, MA 02111-1307, USA.  */
 	  {							\
 	    builtin_define ("_HPUX_SOURCE");			\
 	    builtin_define ("_INCLUDE_LONGLONG");		\
+	    builtin_define ("__STDC_EXT__");			\
 	  }							\
 	else if (!flag_iso)					\
 	  {							\
Index: config/pa/pa-hpux11.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux11.h,v
retrieving revision 1.10
diff -u -3 -p -r1.10 pa-hpux11.h
--- config/pa/pa-hpux11.h	1 Jul 2003 05:45:19 -0000	1.10
+++ config/pa/pa-hpux11.h	7 Aug 2003 22:05:40 -0000
@@ -18,6 +18,12 @@ along with GNU CC; see the file COPYING.
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+/* GCC always defines __STDC__.  HP C++ compilers don't define it.  This
+   causes trouble when sys/stdsyms.h is included.  As a work around,
+   we define __STDC_EXT__.  A similar situation exists with respect to
+   the definition of __cplusplus.  We define _INCLUDE_LONGLONG
+   to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
+   support).  */
 #undef TARGET_OS_CPP_BUILTINS
 #define TARGET_OS_CPP_BUILTINS()				\
   do								\
@@ -34,6 +40,7 @@ Boston, MA 02111-1307, USA.  */
 	  {							\
 	    builtin_define ("_HPUX_SOURCE");			\
 	    builtin_define ("_INCLUDE_LONGLONG");		\
+	    builtin_define ("__STDC_EXT__");			\
 	  }							\
 	else							\
 	  {							\


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