OSDN Git Service

* config/i386/crtdll.h: Define EXTRA_OS_CPP_BUILTINS.
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Jun 2002 09:10:04 +0000 (09:10 +0000)
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Jun 2002 09:10:04 +0000 (09:10 +0000)
Don't use CPP_PREDEFINES.
* config/i386/cygwin.h (EXTRA_OS_CPP_BUILTINS): New.
Used TARGET_OS_CPP_BUILTINS in preference to CPP_PREDEFINES.
* config/i386/djgpp.h, config/i386/i386-coff.h,
config/i386/i386-interix.h, config/i386/i386-interix3.h,
config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h,
config/i386/openbsd.h, config/i386/ptx4-i.h, config/i386/sysv3.h,
config/i386/uwin.h: Similarly.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55101 138bc75d-0d04-0410-961f-82ee72b054a4

14 files changed:
gcc/ChangeLog
gcc/config/i386/crtdll.h
gcc/config/i386/cygwin.h
gcc/config/i386/djgpp.h
gcc/config/i386/i386-coff.h
gcc/config/i386/i386-interix.h
gcc/config/i386/i386-interix3.h
gcc/config/i386/lynx-ng.h
gcc/config/i386/lynx.h
gcc/config/i386/mingw32.h
gcc/config/i386/openbsd.h
gcc/config/i386/ptx4-i.h
gcc/config/i386/sysv3.h
gcc/config/i386/uwin.h

index 01539f5..d2775fd 100644 (file)
@@ -1,3 +1,15 @@
+2002-06-29  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * config/i386/crtdll.h: Define EXTRA_OS_CPP_BUILTINS.
+       Don't use CPP_PREDEFINES.
+       * config/i386/cygwin.h (EXTRA_OS_CPP_BUILTINS): New.
+       Used TARGET_OS_CPP_BUILTINS in preference to CPP_PREDEFINES.
+       * config/i386/djgpp.h, config/i386/i386-coff.h,
+       config/i386/i386-interix.h, config/i386/i386-interix3.h,
+       config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h,
+       config/i386/openbsd.h, config/i386/ptx4-i.h, config/i386/sysv3.h,
+       config/i386/uwin.h: Similarly.
+
 2002-06-29  Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
 
         * c4x.h: (TARGET_CPU_CPP_BUILTINS): Check flag_inline_functions and
index f3eae84..dab60c1 100644 (file)
@@ -20,10 +20,9 @@ along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D_WIN32 -DWIN32 \
-  -D__MINGW32__=0.2 -DWINNT  -D_X86_=1 \
-  -Asystem=winnt"
+#undef EXTRA_OS_CPP_BUILTINS
+#define EXTRA_OS_CPP_BUILTINS() \
+  do { builtin_define ("__MINGW32__=0.2"); } while (0)
 
 #undef LIBGCC_SPEC
 #define LIBGCC_SPEC \
index 15a5cdb..e849c9b 100644 (file)
@@ -54,8 +54,23 @@ Boston, MA 02111-1307, USA.  */
 { "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" },       \
 { "threads",             0, N_("Use Mingw-specific thread support") },
 
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D_X86_=1 -Asystem=winnt"
+#define MAYBE_UWIN_CPP_BUILTINS() /* Nothing.  */
+#define TARGET_OS_CPP_BUILTINS()                                       \
+  do                                                                   \
+    {                                                                  \
+       builtin_define ("_X86_=1");                                     \
+       builtin_assert ("system=winnt");                                \
+       builtin_define ("__stdcall=__attribute__((__stdcall__))");      \
+       builtin_define ("__cdecl=__attribute__((__cdecl__))");          \
+       builtin_define ("__declspec(x)=__attribute__((x))");            \
+       if (!flag_iso)                                                  \
+         {                                                             \
+           builtin_define ("_stdcall=__attribute__((__stdcall__))");   \
+           builtin_define ("_cdecl=__attribute__((__cdecl__))");       \
+         }                                                             \
+       MAYBE_UWIN_CPP_BUILTINS ();                                     \
+    }                                                                  \
+  while (0)
 
 #ifdef CROSS_COMPILE
 #define CYGWIN_INCLUDES "%{!nostdinc:-idirafter " CYGWIN_CROSS_DIR "/include}"
@@ -97,12 +112,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CPP_SPEC
 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} \
-  -D__stdcall=__attribute__((__stdcall__)) \
-  -D__cdecl=__attribute__((__cdecl__)) \
-  %{!ansi:-D_stdcall=__attribute__((__stdcall__)) \
-    -D_cdecl=__attribute__((__cdecl__))} \
-  -D__declspec(x)=__attribute__((x)) \
-  -D__i386__ -D__i386 \
   %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
   %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{mthreads:-D_MT} "\
     MINGW_INCLUDES "} \
index 15c1531..3afafd0 100644 (file)
@@ -82,13 +82,18 @@ Boston, MA 02111-1307, USA.  */
         (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
         (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
 
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__MSDOS__ -D__GO32__ -Asystem=msdos"
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+       builtin_define_std ("MSDOS");           \
+       builtin_define_std ("GO32");            \
+       builtin_assert ("system=msdos");        \
+    }                                          \
+  while (0)
 
 /* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined.  */
 #undef CPP_SPEC
 #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
-  %{!ansi:%{!std=c*:%{!std=i*:-DMSDOS}}} %{!ansi:%{!std=c*:%{!std=i*:-DGO32}}} \
   -imacros %s../include/sys/version.h"
 
 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
index 5f3ed14..d4d1553 100644 (file)
@@ -21,12 +21,9 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 
-#define TARGET_VERSION fprintf (stderr, " (80386, COFF BSD syntax)"); 
+#define TARGET_VERSION fprintf (stderr, " (80386, COFF BSD syntax)");
 
-/* Specify predefined symbols in preprocessor.  */
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES ""
+#define TARGET_OS_CPP_BUILTINS() /* Sweet FA.  */
 
 /* We want to be able to get DBX debugging information via -gstabs.  */
 
index 101f812..6d74150 100644 (file)
@@ -53,30 +53,37 @@ Boston, MA 02111-1307, USA.  */
 #define ASM_LOAD_ADDR(loc, reg)   "     leal " #loc "," #reg "\n"
 
 /* cpp handles __STDC__ */
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES " \
-  -D__INTERIX \
-  -D__OPENNT \
-  -D_M_IX86=300 -D_X86_=1 \
-  -D__stdcall=__attribute__((__stdcall__)) \
-  -D__cdecl=__attribute__((__cdecl__)) \
-  -D__declspec(x)=__attribute__((x)) \
-  -Asystem=unix -Asystem=interix"
+#define TARGET_OS_CPP_BUILTINS()                                       \
+  do                                                                   \
+    {                                                                  \
+       builtin_define ("__INTERIX");                                   \
+       builtin_define ("__OPENNT");                                    \
+       builtin_define ("_M_IX86=300");                                 \
+       builtin_define ("_X86_=1");                                     \
+       builtin_define ("__stdcall=__attribute__((__stdcall__))");      \
+       builtin_define ("__cdecl=__attribute__((__cdecl__))");          \
+       builtin_define ("__declspec(x)=__attribute__((x))");            \
+       builtin_assert ("system=unix");                                 \
+       builtin_assert ("system=interix");                              \
+       if (preprocessing_asm_p ())                                     \
+         builtin_define_std ("LANGUAGE_ASSEMBLY");                     \
+       else                                                            \
+         {                                                             \
+            builtin_define_std ("LANGUAGE_C");                         \
+            if (c_language == clk_cplusplus)                           \
+              builtin_define_std ("LANGUAGE_C_PLUS_PLUS");             \
+            else if (c_language == clk_objective_c)                    \
+              builtin_define_std ("LANGUAGE_OBJECTIVE_C");             \
+         }                                                             \
+    }                                                                  \
+  while (0)
 
 #undef CPP_SPEC
 /* Write out the correct language type definition for the header files.  
    Unless we have assembler language, write out the symbols for C.
    mieee is an Alpha specific variant.  Cross polination a bad idea.
    */
-#define CPP_SPEC "\
-%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}  \
-%{.S:  -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
-%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.cxx:        -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.C:  -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.m:  -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C} \
--remap \
-%{posix:-D_POSIX_SOURCE} \
+#define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
 -isystem %$INTERIX_ROOT/usr/include"
 
 #define TARGET_VERSION fprintf (stderr, " (i386 Interix)");
index 38c6c55..aafe57f 100644 (file)
@@ -20,12 +20,5 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 #undef CPP_SPEC
-#define CPP_SPEC "\
-%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}  \
-%{.S:  -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
-%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.cxx:        -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.C:  -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.m:  -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C} \
-%{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
 
index 1ef22fb..08fa60f 100644 (file)
@@ -20,9 +20,17 @@ Boston, MA 02111-1307, USA.  */
 
 #define TARGET_VERSION fprintf (stderr, " (80386, LYNX BSD syntax)"); 
 
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -DI386 -DLynx -DIBITS32 \
-  -Asystem=unix -Asystem=lynx"
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+       builtin_define_std ("unix");            \
+       builtin_define_std ("I386");            \
+       builtin_define_std ("Lynx");            \
+       builtin_define_std ("IBITS32");         \
+       builtin_assert ("system=unix");         \
+       builtin_assert ("system=lynx");         \
+    }                                          \
+  while (0)
 
 /* Provide required defaults for linker switches.  */
 
index 00fc0ac..7835f27 100644 (file)
@@ -20,8 +20,16 @@ Boston, MA 02111-1307, USA.  */
 
 #define TARGET_VERSION fprintf (stderr, " (80386, LYNX BSD syntax)"); 
 
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-DI386 -DLynx -DIBITS32 -Asystem=unix -Asystem=lynx"
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+       builtin_define_std ("I386");            \
+       builtin_define_std ("Lynx");            \
+       builtin_define_std ("IBITS32");         \
+       builtin_assert ("system=unix");         \
+       builtin_assert ("system=lynx");         \
+    }                                          \
+  while (0)
 
 /* The prefix to add to user-visible assembler symbols.  */
 
index c5b8701..6b367eb 100644 (file)
@@ -32,13 +32,35 @@ Boston, MA 02111-1307, USA.  */
 
 #define TARGET_EXECUTABLE_SUFFIX ".exe"
 
-/* Please keep changes to CPP_PREDEFINES in sync with i386/crtdll. The
-   only difference between the two should be __MSVCRT__ needed to 
-   distinguish MSVC from CRTDLL runtime in mingw headers.  */
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D_WIN32 -D__WIN32 -D__WIN32__ -DWIN32 \
-  -D__MINGW32__ -D__MSVCRT__ -DWINNT -D_X86_=1 \
-  -Asystem=winnt"
+/* See i386/crtdll.h for an altervative definition.  */
+#define EXTRA_OS_CPP_BUILTINS()                                        \
+  do                                                           \
+    {                                                          \
+      builtin_define ("__MSVCRT__");                           \
+      builtin_define ("__MINGW32__");                          \
+    }                                                          \
+  while (0)
+
+#undef TARGET_OS_CPP_BUILTINS  /* From cygwin.h.  */
+#define TARGET_OS_CPP_BUILTINS()                                       \
+  do                                                                   \
+    {                                                                  \
+       builtin_define ("_WIN32");                                      \
+       builtin_define_std ("WIN32");                                   \
+       builtin_define_std ("WINNT");                                   \
+       builtin_define ("_X86_=1");                                     \
+       builtin_define ("__stdcall=__attribute__((__stdcall__))");      \
+       builtin_define ("__cdecl=__attribute__((__cdecl__))");          \
+       builtin_define ("__declspec(x)=__attribute__((x))");            \
+       if (!flag_iso)                                                  \
+         {                                                             \
+           builtin_define ("_stdcall=__attribute__((__stdcall__))");   \
+           builtin_define ("_cdecl=__attribute__((__cdecl__))");       \
+         }                                                             \
+       EXTRA_OS_CPP_BUILTINS ();                                       \
+       builtin_assert ("system=winnt");                                \
+    }                                                                  \
+  while (0)
 
 /* Specific a different directory for the standard include files.  */
 #undef STANDARD_INCLUDE_DIR
@@ -47,14 +69,7 @@ Boston, MA 02111-1307, USA.  */
 #define STANDARD_INCLUDE_COMPONENT "MINGW"
 
 #undef CPP_SPEC
-#define CPP_SPEC \
-  "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} \
-  -D__stdcall=__attribute__((__stdcall__)) \
-  -D__cdecl=__attribute__((__cdecl__)) \
-  %{!ansi:-D_stdcall=__attribute__((__stdcall__)) \
-    -D_cdecl=__attribute__((__cdecl__))} \
-  -D__declspec(x)=__attribute__((x))"
-
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}"
 
 /* For Windows applications, include more libraries, but always include
    kernel32.  */
index 9b7ce3e..8f54026 100644 (file)
@@ -26,9 +26,16 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_SUBTARGET_DEFAULT \
   (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
 
-/* Run-time target specifications */
-#define CPP_PREDEFINES "-D__unix__ -D__OpenBSD__ \
- -Asystem=unix -Asystem=bsd -Asystem=OpenBSD"
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+       builtin_define ("__unix__");            \
+       builtin_define ("__OpenBSD__");         \
+       builtin_assert ("system=unix");         \
+       builtin_assert ("system=bsd");          \
+       builtin_assert ("system=OpenBSD");      \
+    }                                          \
+  while (0)
 
 /* Layout of source language data types.  */
 
index d29bdad..a7d5710 100644 (file)
@@ -33,11 +33,15 @@ Boston, MA 02111-1307, USA.  */
   (TYPE_MODE (TYPE) == BLKmode \
    || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
 
-/* Define which macros to predefine.  _SEQUENT_ is our extension.  */
-/* This used to define X86, but james@bigtex.cactus.org says that
-   is supposed to be defined optionally by user programs--not by default.  */
-#define CPP_PREDEFINES \
-  "-Dunix -D_SEQUENT_ -Asystem=unix -Asystem=ptx4"
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+       builtin_define_std ("unix");            \
+       builtin_define ("_SEQUENT_");           \
+       builtin_assert ("system=unix");         \
+       builtin_assert ("system=ptx4");         \
+    }                                          \
+  while (0)
 
 #undef DBX_REGISTER_NUMBER
 #define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
index 07dadb8..67194f4 100644 (file)
@@ -32,7 +32,13 @@ Boston, MA 02111-1307, USA.  */
 
 /* Specify predefined symbols in preprocessor.  */
 
-#define CPP_PREDEFINES "-Dunix -Asystem=svr3"
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+       builtin_define_std ("unix");            \
+       builtin_assert ("system=svr3");         \
+    }                                          \
+  while (0)
 
 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
 
index b5865ac..1210510 100644 (file)
@@ -30,16 +30,19 @@ Boston, MA 02111-1307, USA.  */
 #undef MD_STARTFILE_PREFIX
 #define MD_STARTFILE_PREFIX "/usr/gnu/lib/"
 
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D_WIN32 -D__WIN32__ \
-  -D_UWIN -DWINNT  -D_X86_=1 -D__STDC__=1 \
-  -D__UWIN__ -D__MSVCRT__ \
-  -D_STD_INCLUDE_DIR=mingw32 \
-  -D__stdcall=__attribute__((__stdcall__)) \
-  _D_stdcall=__attribute__((__stdcall__)) \
-  -D__cdecl=__attribute__((__cdecl__)) \
-  -D__declspec(x)=__attribute__((x)) \
-  -Asystem=winnt"
+#undef MAYBE_UWIN_CPP_BUILTINS
+#define MAYBE_UWIN_CPP_BUILTINS()                      \
+  do                                                   \
+    {                                                  \
+       builtin_define_std ("WINNT");                   \
+       builtin_define ("_WIN32");                      \
+       builtin_define ("__WIN32__");                   \
+       builtin_define ("_UWIN");                       \
+       builtin_define ("__UWIN__");                    \
+       builtin_define ("__MSVCRT__");                  \
+       builtin_define ("_STD_INCLUDE_DIR=mingw32");    \
+    }                                                  \
+  while (0)
 
 #undef CPP_SPEC
 #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \