OSDN Git Service

Blow away a duplicate definition of "pow()" for C++
authorkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Jun 2001 03:51:26 +0000 (03:51 +0000)
committerkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Jun 2001 03:51:26 +0000 (03:51 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43358 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def

index 1deae2b..cdf54c6 100644 (file)
@@ -1,3 +1,7 @@
+2001-06-13  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * inclhack.def (hpux10_cpp_pow_inline): New hack.
+
 2001-06-13  Richard Henderson  <rth@redhat.com>
 
        * ifcvt.c (dead_or_predicable): Fix return value last patch.
 2001-06-13  Richard Henderson  <rth@redhat.com>
 
        * ifcvt.c (dead_or_predicable): Fix return value last patch.
index da19e6c..2dde85a 100644 (file)
@@ -5,7 +5,7 @@
  * files which are fixed to work correctly with ANSI C and placed in a
  * directory that GNU C will search.
  *
  * files which are fixed to work correctly with ANSI C and placed in a
  * directory that GNU C will search.
  *
- * This file contains 139 fixup descriptions.
+ * This file contains 140 fixup descriptions.
  *
  * See README for more information.
  *
  *
  * See README for more information.
  *
@@ -1945,6 +1945,48 @@ static const char* apzHp_SysfilePatch[] = {
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Hpux10_Cpp_Pow_Inline fix
+ */
+tSCC zHpux10_Cpp_Pow_InlineName[] =
+     "hpux10_cpp_pow_inline";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zHpux10_Cpp_Pow_InlineList[] =
+  "|math.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+#define apzHpux10_Cpp_Pow_InlineMachs (const char**)NULL
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zHpux10_Cpp_Pow_InlineSelect0[] =
+       "^# +ifdef +__cplusplus\n\
+ +}\n\
+ +inline +double +pow\\(double +__d,int +__expon\\) +{\n\
+[ \t]+return +pow\\(__d,\\(double\\)__expon\\);\n\
+ +}\n\
+ +extern +\"C\" +{\n\
+#else\n\
+# +endif";
+
+#define    HPUX10_CPP_POW_INLINE_TEST_CT  1
+static tTestDesc aHpux10_Cpp_Pow_InlineTests[] = {
+  { TT_EGREP,    zHpux10_Cpp_Pow_InlineSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Hpux10_Cpp_Pow_Inline
+ */
+static const char* apzHpux10_Cpp_Pow_InlinePatch[] = {
+    "format",
+    "",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Hpux11_Fabsf fix
  */
 tSCC zHpux11_FabsfName[] =
  *  Description of Hpux11_Fabsf fix
  */
 tSCC zHpux11_FabsfName[] =
@@ -5424,9 +5466,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          146
+#define REGEX_COUNT          147
 #define MACH_LIST_SIZE_LIMIT 279
 #define MACH_LIST_SIZE_LIMIT 279
-#define FIX_COUNT            139
+#define FIX_COUNT            140
 
 /*
  *  Enumerate the fixes
 
 /*
  *  Enumerate the fixes
@@ -5480,6 +5522,7 @@ typedef enum {
     GNU_TYPES_FIXIDX,
     HP_INLINE_FIXIDX,
     HP_SYSFILE_FIXIDX,
     GNU_TYPES_FIXIDX,
     HP_INLINE_FIXIDX,
     HP_SYSFILE_FIXIDX,
+    HPUX10_CPP_POW_INLINE_FIXIDX,
     HPUX11_FABSF_FIXIDX,
     HPUX11_UINT32_C_FIXIDX,
     HPUX8_BOGUS_INLINES_FIXIDX,
     HPUX11_FABSF_FIXIDX,
     HPUX11_UINT32_C_FIXIDX,
     HPUX8_BOGUS_INLINES_FIXIDX,
@@ -5814,6 +5857,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      HP_SYSFILE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aHp_SysfileTests,   apzHp_SysfilePatch, 0 },
 
      HP_SYSFILE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aHp_SysfileTests,   apzHp_SysfilePatch, 0 },
 
+  {  zHpux10_Cpp_Pow_InlineName,    zHpux10_Cpp_Pow_InlineList,
+     apzHpux10_Cpp_Pow_InlineMachs,
+     HPUX10_CPP_POW_INLINE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aHpux10_Cpp_Pow_InlineTests,   apzHpux10_Cpp_Pow_InlinePatch, 0 },
+
   {  zHpux11_FabsfName,    zHpux11_FabsfList,
      apzHpux11_FabsfMachs,
      HPUX11_FABSF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
   {  zHpux11_FabsfName,    zHpux11_FabsfList,
      apzHpux11_FabsfMachs,
      HPUX11_FABSF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index 88018d9..7730cd2 100644 (file)
@@ -1149,6 +1149,39 @@ fix = {
 
 
 /*
 
 
 /*
+ * Delete C++ double pow (double, int) inline function from HP-UX 10
+ * math.h to prevent clash with define in c_std/bits/std_cmath.h.
+ */
+fix = {
+    hackname  = hpux10_cpp_pow_inline;
+    files     = math.h;
+    select    = <<-    END_POW_INLINE
+       ^# +ifdef +__cplusplus
+        +}
+        +inline +double +pow\(double +__d,int +__expon\) +{
+       [       ]+return +pow\(__d,\(double\)__expon\);
+        +}
+        +extern +"C" +{
+       #else
+       # +endif
+       END_POW_INLINE;
+    c_fix     = format;
+    c_fix_arg = "";
+
+    test_text =
+       "#    ifdef __cplusplus\n"
+       "     }\n"
+       "     inline double pow(double __d,int __expon) {\n"
+       "\t return pow(__d,(double)__expon);\n"
+       "     }\n"
+       '     extern "C"' " {\n"
+       "#else\n"
+       "#    endif";
+};
+
+
+/*
  *  Keep HP-UX 11 from stomping on C++ math namespace
  *  with defines for fabsf.
  */
  *  Keep HP-UX 11 from stomping on C++ math namespace
  *  with defines for fabsf.
  */