]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/i386/winnt-d.cc
Fix signed vs unsigned issue in H8 port
[thirdparty/gcc.git] / gcc / config / i386 / winnt-d.cc
CommitLineData
2892e2f7 1/* Windows support needed only by D front-end.
7adcbafe 2 Copyright (C) 2021-2022 Free Software Foundation, Inc.
2892e2f7
IB
3
4GCC is free software; you can redistribute it and/or modify it under
5the terms of the GNU General Public License as published by the Free
6Software Foundation; either version 3, or (at your option) any later
7version.
8
9GCC is distributed in the hope that it will be useful, but WITHOUT ANY
10WARRANTY; without even the implied warranty of MERCHANTABILITY or
11FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12for more details.
13
14You should have received a copy of the GNU General Public License
15along with GCC; see the file COPYING3. If not see
16<http://www.gnu.org/licenses/>. */
17
18#define IN_TARGET_CODE 1
19
20#include "config.h"
21#include "system.h"
22#include "coretypes.h"
23#include "target.h"
d5ad6f84 24#include "tm_d.h"
2892e2f7
IB
25#include "d/d-target.h"
26#include "d/d-target-def.h"
2892e2f7
IB
27
28/* Implement TARGET_D_OS_VERSIONS for Windows targets. */
29
30static void
31winnt_d_os_builtins (void)
32{
33 d_add_builtin_version ("Windows");
34
35#define builtin_version(TXT) d_add_builtin_version (TXT)
36
37#ifdef EXTRA_TARGET_D_OS_VERSIONS
38 EXTRA_TARGET_D_OS_VERSIONS ();
39#endif
40}
41
d81bc495
IB
42/* Handle a call to `__traits(getTargetInfo, "objectFormat")'. */
43
44static tree
45winnt_d_handle_target_object_format (void)
46{
47 const char *objfmt = "coff";
48
49 return build_string_literal (strlen (objfmt) + 1, objfmt);
50}
51
52/* Implement TARGET_D_REGISTER_OS_TARGET_INFO for Windows targets. */
53
54static void
55winnt_d_register_target_info (void)
56{
57 const struct d_target_info_spec handlers[] = {
58 { "objectFormat", winnt_d_handle_target_object_format },
59 { NULL, NULL },
60 };
61
62 d_add_target_info_handlers (handlers);
63}
2892e2f7
IB
64#undef TARGET_D_OS_VERSIONS
65#define TARGET_D_OS_VERSIONS winnt_d_os_builtins
66
d81bc495
IB
67#undef TARGET_D_REGISTER_OS_TARGET_INFO
68#define TARGET_D_REGISTER_OS_TARGET_INFO winnt_d_register_target_info
69
2892e2f7
IB
70/* Define TARGET_D_MINFO_SECTION for Windows targets. */
71
72#undef TARGET_D_MINFO_SECTION
73#define TARGET_D_MINFO_SECTION "minfo"
74
75#undef TARGET_D_MINFO_START_NAME
76#define TARGET_D_MINFO_START_NAME "__start_minfo"
77
78#undef TARGET_D_MINFO_END_NAME
79#define TARGET_D_MINFO_END_NAME "__stop_minfo"
80
bda51959
IB
81/* Define TARGET_D_TEMPLATES_ALWAYS_COMDAT for Windows targets. */
82
83#undef TARGET_D_TEMPLATES_ALWAYS_COMDAT
84#define TARGET_D_TEMPLATES_ALWAYS_COMDAT true
85
2892e2f7 86struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;