import of gcc-2.8
[official-gcc.git] / gcc / config / i386 / mingw32.h
blob984a3692c3094756006baf0bd931cfb29ae8400d
1 /* Operating system specific defines to be used when targeting GCC for
2 hosting on Windows32, using GNU tools and the Windows32 API Library,
3 as distinct from winnt.h, which is used to build GCC for use with a
4 windows style library and tool set and uses the Microsoft tools.
5 Copyright (C) 1997 Free Software Foundation, Inc.
7 This file is part of GNU CC.
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.
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.
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. */
24 /* Most of this is the same as for Cygwin32, except for changing some
25 specs. */
27 #include "i386/cygwin32.h"
29 #undef CPP_PREDEFINES
30 #define CPP_PREDEFINES "-Di386 -D_WIN32 -DWIN32 -D__WIN32__ \
31 -D__MINGW32__ -DWINNT -D_X86_=1 -D__STDC__=1\
32 -D__stdcall=__attribute__((__stdcall__)) \
33 -D__cdecl=__attribute__((__cdecl__)) \
34 -Asystem(winnt) -Acpu(i386) -Amachine(i386)"
36 /* Specific a different directory for the standard include files. */
37 #undef STANDARD_INCLUDE_DIR
38 #define STANDARD_INCLUDE_DIR "/usr/mingw32/include"
40 #define STANDARD_INCLUDE_COMPONENT "MINGW32"
42 /* For Windows applications, include more libraries, but always include
43 kernel32. */
44 #undef LIB_SPEC
45 #define LIB_SPEC \
46 "%{mwindows:-luser32 -lgdi32 -lcomdlg32} -lkernel32 -ladvapi32 -lshell32"
48 /* Include in the mingw32 libraries with libgcc */
49 #undef LIBGCC_SPEC
50 #define LIBGCC_SPEC "-lmingw32 -lgcc -lmoldname -lcrtdll"
52 /* Specify a different entry point when linking a DLL */
53 #undef LINK_SPEC
54 #define LINK_SPEC \
55 "%{mwindows:--subsystem windows} %{mdll:--dll -e _DllMainCRTStartup@12}"
57 #undef STARTFILE_SPEC
58 #define STARTFILE_SPEC "%{mdll:dllcrt1%O%s} %{!mdll:crt1%O%s}"
60 #define MATH_LIBRARY "-lcrtdll"
62 /* Output STRING, a string representing a filename, to FILE. We canonicalize
63 it to be in MS-DOS format. */
64 #define OUTPUT_QUOTED_STRING(FILE, STRING) \
65 do { \
66 char c; \
68 putc ('\"', asm_file); \
69 if (STRING[1] == ':' \
70 && (STRING[2] == '/' || STRING[2] == '\\')) \
71 { \
72 putc ('/', asm_file); \
73 putc ('/', asm_file); \
74 putc (*string, asm_file); \
75 string += 2; \
76 } \
78 while ((c = *string++) != 0) \
79 { \
80 if (c == '\\') \
81 c = '/'; \
83 if (c == '\"') \
84 putc ('\\', asm_file); \
85 putc (c, asm_file); \
86 } \
88 putc ('\"', asm_file); \
89 } while (0)
91 /* Dwarf2 exception information does not work on this system for some
92 unknown reason, so turn it off. */
93 #undef INCOMING_RETURN_ADDR_RTX