OSDN Git Service

* c-lang.c (LANG_HOOKS_NAME): New.
[pf3gnuchains/gcc-fork.git] / gcc / config / xm-interix.h
1 /* Configuration for GNU compiler for processor running Interix
2    Copyright (C) 1993, 1995, 1999, 2001 Free Software Foundation, Inc.
3    Donn Terry, Softway Systems, Inc,
4    from code
5       Contributed by Douglas B. Rupp (drupp@cs.washington.edu)
6
7 This file is part of GNU CC.
8
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING.  If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.  */
23
24 /* Our strategy for finding global constructors is a bit different, although
25    not a lot. */
26 #define DO_GLOBAL_CTORS_BODY                                            \
27 do {                                                                    \
28   int i;                                                                \
29   unsigned long nptrs;                                                  \
30   func_ptr *p;                                                          \
31   asm(                                                                  \
32        "     .section .ctor_head, \"rw\"\n"                             \
33        "1:\n"                                                           \
34        "     .text \n"                                                  \
35        ASM_LOAD_ADDR(1b,%0)                                             \
36        : "=r" (p) : : "cc");                                            \
37   for (nptrs = 0; p[nptrs] != 0; nptrs++);                              \
38   for (i = nptrs-1; i >= 0; i--)                                        \
39     p[i] ();                                                            \
40 } while (0) 
41
42 #define DO_GLOBAL_DTORS_BODY                                            \
43 do {                                                                    \
44   func_ptr *p;                                                          \
45   asm(                                                                  \
46        "     .section .dtor_head, \"rw\"\n"                             \
47        "1:\n"                                                           \
48        "     .text \n"                                                  \
49        ASM_LOAD_ADDR(1b,%0)                                             \
50        : "=r" (p) : : "cc");                                            \
51   while (*p)                                                            \
52     {                                                                   \
53       p++;                                                              \
54       (*(p-1)) ();                                                      \
55     }                                                                   \
56 } while (0)