]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/i386/mingw32.h
pr18096-1.c: Change dg-warning to dg-error.
[thirdparty/gcc.git] / gcc / config / i386 / mingw32.h
CommitLineData
6407d0da 1/* Operating system specific defines to be used when targeting GCC for
db009825 2 hosting on Windows32, using GNU tools and the Windows32 API Library.
caec2cfc 3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
e898926c 4 Free Software Foundation, Inc.
6407d0da 5
188fc5b5 6This file is part of GCC.
6407d0da 7
188fc5b5 8GCC is free software; you can redistribute it and/or modify
6407d0da
RK
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2, or (at your option)
11any later version.
12
188fc5b5 13GCC is distributed in the hope that it will be useful,
6407d0da
RK
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
188fc5b5 19along with GCC; see the file COPYING. If not, write to
39d14dda
KC
20the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21Boston, MA 02110-1301, USA. */
6407d0da 22
70e5e841 23#undef TARGET_VERSION
ccf8e764
RH
24#if TARGET_64BIT_DEFAULT
25#define TARGET_VERSION fprintf (stderr,"(x86_64 MinGW");
26#else
27#define TARGET_VERSION fprintf (stderr," (x86 MinGW)");
28#endif
45936a85 29
d1f87653 30/* See i386/crtdll.h for an alternative definition. */
f60ed6be
NB
31#define EXTRA_OS_CPP_BUILTINS() \
32 do \
33 { \
34 builtin_define ("__MSVCRT__"); \
35 builtin_define ("__MINGW32__"); \
70e5e841
CF
36 builtin_define ("_WIN32"); \
37 builtin_define_std ("WIN32"); \
38 builtin_define_std ("WINNT"); \
ccf8e764
RH
39 if (TARGET_64BIT_MS_ABI) \
40 { \
41 builtin_define ("__MINGW64__"); \
42 builtin_define_with_value("_INTEGRAL_MAX_BITS","64",0); \
43 builtin_define_std ("WIN64"); \
44 builtin_define_std ("_WIN64"); \
45 } \
46 else \
47 { \
48 builtin_define_with_value("_INTEGRAL_MAX_BITS","32",0); \
49 } \
f60ed6be
NB
50 } \
51 while (0)
52
0bcbfabb
AL
53/* Override the standard choice of /usr/include as the default prefix
54 to try when searching for header files. */
23092526 55#undef STANDARD_INCLUDE_DIR
ccf8e764
RH
56#if TARGET_64BIT_DEFAULT
57#define STANDARD_INCLUDE_DIR "/mingw/include64"
58#else
0bcbfabb 59#define STANDARD_INCLUDE_DIR "/mingw/include"
ccf8e764 60#endif
0a977123
CF
61#undef STANDARD_INCLUDE_COMPONENT
62#define STANDARD_INCLUDE_COMPONENT "MINGW"
23092526 63
2b9f972f 64#undef CPP_SPEC
f60ed6be 65#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}"
2b9f972f 66
6407d0da
RK
67/* For Windows applications, include more libraries, but always include
68 kernel32. */
69#undef LIB_SPEC
9b0b6c51 70#define LIB_SPEC "%{pg:-lgmon} %{mwindows:-lgdi32 -lcomdlg32} \
c6df90d8 71 -luser32 -lkernel32 -ladvapi32 -lshell32"
6407d0da 72
9c7c6e6c
TP
73/* Include in the mingw32 libraries with libgcc */
74#undef LINK_SPEC
75#define LINK_SPEC "%{mwindows:--subsystem windows} \
76 %{mconsole:--subsystem console} \
77 %{shared: %{mdll: %eshared and mdll are not compatible}} \
78 %{shared: --shared} %{mdll:--dll} \
79 %{static:-Bstatic} %{!static:-Bdynamic} \
80 %{shared|mdll: -e _DllMainCRTStartup@12}"
81
23092526 82/* Include in the mingw32 libraries with libgcc */
6407d0da 83#undef LIBGCC_SPEC
f22a97d2 84#define LIBGCC_SPEC \
e898926c 85 "%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt"
6407d0da 86
23092526 87#undef STARTFILE_SPEC
9c7c6e6c
TP
88#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
89 %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}"
23092526 90
656c7a3a
AL
91/* Override startfile prefix defaults. */
92#ifndef STANDARD_STARTFILE_PREFIX_1
ccf8e764
RH
93#if TARGET_64BIT_DEFAULT
94#define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib64/"
95#else
656c7a3a
AL
96#define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/"
97#endif
ccf8e764 98#endif
656c7a3a
AL
99#ifndef STANDARD_STARTFILE_PREFIX_2
100#define STANDARD_STARTFILE_PREFIX_2 ""
101#endif
0bcbfabb 102
0a977123 103/* Output STRING, a string representing a filename, to FILE.
d1f87653 104 We canonicalize it to be in Unix format (backslashes are replaced
211a0cbe 105 forward slashes. */
0a977123 106#undef OUTPUT_QUOTED_STRING
211a0cbe
GDR
107#define OUTPUT_QUOTED_STRING(FILE, STRING) \
108do { \
109 char c; \
110 \
111 putc ('\"', asm_file); \
112 \
113 while ((c = *string++) != 0) \
114 { \
115 if (c == '\\') \
116 c = '/'; \
117 \
118 if (ISPRINT (c)) \
119 { \
120 if (c == '\"') \
121 putc ('\\', asm_file); \
122 putc (c, asm_file); \
123 } \
124 else \
125 fprintf (asm_file, "\\%03o", (unsigned char) c); \
126 } \
127 \
128 putc ('\"', asm_file); \
23092526
MK
129} while (0)
130
d1f87653 131/* Define as short unsigned for compatibility with MS runtime. */
355426ab
DS
132#undef WINT_TYPE
133#define WINT_TYPE "short unsigned int"
33815e0c 134
4d51dc9e 135/* mingw32 uses the -mthreads option to enable thread support. */
33815e0c 136#undef GOMP_SELF_SPECS
4d51dc9e 137#define GOMP_SELF_SPECS "%{fopenmp: -mthreads}"
97388150
DS
138
139/* mingw32 atexit function is safe to use in shared libraries. Use it
140 to register C++ static destructors. */
141#define TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT hook_bool_void_true