OSDN Git Service

2007-07-04 David Ung <davidu@mips.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / interix.h
index 054ce7d..0fa5dee 100644 (file)
@@ -1,28 +1,26 @@
 /* Operating system specific defines to be used when targeting GCC for
    Interix
-   Copyright (C) 1994, 1995, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1999, 2002, 2004 Free Software Foundation, Inc.
    Donn Terry, Softway Systems, Inc. (donn@softway.com)
    Modified from code
       Contributed by Douglas B. Rupp (drupp@cs.washington.edu).
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-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 TARGET_MEM_FUNCTIONS
+along with GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 /* POSIX/Uni-thread only for now.  Look at the winnt version
 for windows/multi thread */
@@ -68,29 +66,15 @@ for windows/multi thread */
   && strcmp (STR, "Tbss"))
 
 
-#if 0  
-/* don't do this until we can sort out the default path issues. MK */
-#undef STANDARD_EXEC_PREFIX
-#define STANDARD_EXEC_PREFIX ""
-
-#undef STANDARD_STARTFILE_PREFIX
-#define STANDARD_STARTFILE_PREFIX ""
-
-#undef TOOLDIR_BASE_PREFIX
-#define TOOLDIR_BASE_PREFIX ""
+#define STDC_0_IN_SYSTEM_HEADERS 1
 
-#endif /* 0 */
-
-#undef STDC_VALUE
-#define STDC_VALUE 0
-
-#define HANDLE_SYSV_PRAGMA
+#define HANDLE_SYSV_PRAGMA 1
 #undef HANDLE_PRAGMA_WEAK  /* until the link format can handle it */
 
 /* Names to predefine in the preprocessor for this target machine.  */
 
-#define DBX_DEBUGGING_INFO
-#define SDB_DEBUGGING_INFO
+#define DBX_DEBUGGING_INFO 1
+#define SDB_DEBUGGING_INFO 1
 #undef PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
 
@@ -99,6 +83,39 @@ for windows/multi thread */
 
 #undef WCHAR_TYPE
 #undef WCHAR_TYPE_SIZE
-#define WCHAR_UNSIGNED 1
 #define WCHAR_TYPE "short unsigned int"
 #define WCHAR_TYPE_SIZE 16
+
+/* Our strategy for finding global constructors is a bit different, although
+   not a lot.  */
+#define DO_GLOBAL_CTORS_BODY                                           \
+do {                                                                   \
+  int i;                                                               \
+  unsigned long nptrs;                                                 \
+  func_ptr *p;                                                         \
+  asm(                                                                 \
+       "     .section .ctor_head, \"rw\"\n"                            \
+       "1:\n"                                                          \
+       "     .text \n"                                                 \
+       ASM_LOAD_ADDR(1b,%0)                                            \
+       : "=r" (p) : : "cc");                                           \
+  for (nptrs = 0; p[nptrs] != 0; nptrs++);                             \
+  for (i = nptrs-1; i >= 0; i--)                                       \
+    p[i] ();                                                           \
+} while (0) 
+
+#define DO_GLOBAL_DTORS_BODY                                           \
+do {                                                                   \
+  func_ptr *p;                                                         \
+  asm(                                                                 \
+       "     .section .dtor_head, \"rw\"\n"                            \
+       "1:\n"                                                          \
+       "     .text \n"                                                 \
+       ASM_LOAD_ADDR(1b,%0)                                            \
+       : "=r" (p) : : "cc");                                           \
+  while (*p)                                                           \
+    {                                                                  \
+      p++;                                                             \
+      (*(p-1)) ();                                                     \
+    }                                                                  \
+} while (0)