OSDN Git Service

* real.c (struct real_format): Move to real.h.
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / cygwin.h
index 09d4e69..be92541 100644 (file)
@@ -20,8 +20,8 @@ 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.  */
 
-#define DBX_DEBUGGING_INFO 
-#define SDB_DEBUGGING_INFO 
+#define DBX_DEBUGGING_INFO 1
+#define SDB_DEBUGGING_INFO 1
 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
 
 #define TARGET_VERSION fprintf (stderr, " (x86 Cygwin)"); 
@@ -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}"
@@ -96,13 +111,7 @@ Boston, MA 02111-1307, USA.  */
    existing args.  */
 
 #undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{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 \
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} \
   %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
   %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{mthreads:-D_MT} "\
     MINGW_INCLUDES "} \
@@ -255,46 +264,16 @@ do {                                                                      \
    section and we need to set DECL_SECTION_NAME so we do that here.
    Note that we can be called twice on the same decl.  */
 
-extern void i386_pe_encode_section_info PARAMS ((TREE, int));
-
-#undef ENCODE_SECTION_INFO
-#define ENCODE_SECTION_INFO(DECL, FIRST) \
-  i386_pe_encode_section_info (DECL, FIRST)
-
-/* Utility used only in this file.  */
-#define I386_PE_STRIP_ENCODING(SYM_NAME) \
-  ((SYM_NAME) + ((SYM_NAME)[0] == '@' \
-                 ? ((SYM_NAME)[3] == '*' ? 4 : 3) : 0) \
-             + ((SYM_NAME)[0] == '*' ? 1 : 0))
-
-/* This macro gets just the user-specified name
-   out of the string in a SYMBOL_REF.  Discard
-   trailing @[NUM] encoded by ENCODE_SECTION_INFO.  */
-#undef  STRIP_NAME_ENCODING
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME)                           \
-do {                                                                   \
-  const char *_p;                                                      \
-  const char *_name = I386_PE_STRIP_ENCODING (SYMBOL_NAME);            \
-  for (_p = _name; *_p && *_p != '@'; ++_p)                            \
-    ;                                                                  \
-  if (*_p == '@')                                                      \
-    {                                                                  \
-      int _len = _p - _name;                                           \
-      char *_new_name = (char *) alloca (_len + 1);                    \
-      strncpy (_new_name, _name, _len);                                        \
-      _new_name[_len] = '\0';                                          \
-      (VAR) = _new_name;                                               \
-    }                                                                  \
-  else                                                                 \
-    (VAR) = _name;                                                     \
-} while (0)
-      
+#undef TARGET_ENCODE_SECTION_INFO
+#define TARGET_ENCODE_SECTION_INFO  i386_pe_encode_section_info
+#undef  TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING  i386_pe_strip_name_encoding_full
 \f
 /* Output a reference to a label.  */
 #undef ASM_OUTPUT_LABELREF
 #define ASM_OUTPUT_LABELREF(STREAM, NAME)              \
   fprintf (STREAM, "%s%s", USER_LABEL_PREFIX,          \
-          I386_PE_STRIP_ENCODING (NAME))               \
+          i386_pe_strip_name_encoding (NAME))          \
 
 /* Output a common block.  */
 #undef ASM_OUTPUT_COMMON
@@ -348,7 +327,7 @@ do {                                                        \
 #define MULTIPLE_SYMBOL_SPACES
 
 extern void i386_pe_unique_section PARAMS ((TREE, int));
-#define UNIQUE_SECTION(DECL,RELOC) i386_pe_unique_section (DECL, RELOC)
+#define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section
 
 #define SUPPORTS_ONE_ONLY 1