1/* d-target.def -- Target hook definitions for the D front end.
2   Copyright (C) 2017-2019 Free Software Foundation, Inc.
3
4   This program is free software; you can redistribute it and/or modify it
5   under the terms of the GNU General Public License as published by the
6   Free Software Foundation; either version 3, or (at your option) any
7   later version.
8
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   GNU General Public License for more details.
13
14   You should have received a copy of the GNU General Public License
15   along with this program; see the file COPYING3.  If not see
16   <http://www.gnu.org/licenses/>.  */
17
18/* See target-hooks-macros.h for details of macros that should be
19   provided by the including file, and how to use them here.  */
20
21#include "target-hooks-macros.h"
22
23#undef HOOK_TYPE
24#define HOOK_TYPE "D Target Hook"
25
26HOOK_VECTOR (TARGETDM_INITIALIZER, gcc_targetdm)
27
28#undef HOOK_PREFIX
29#define HOOK_PREFIX "TARGET_"
30
31/* Environmental version identifiers relating to the target CPU.  */
32DEFHOOK
33(d_cpu_versions,
34 "Declare all environmental version identifiers relating to the target CPU\n\
35using the function @code{builtin_version}, which takes a string representing\n\
36the name of the version.  Version identifiers predefined by this hook apply\n\
37to all modules that are being compiled and imported.",
38 void, (void),
39 hook_void_void)
40
41/* Environmental version identifiers relating to the target OS.  */
42DEFHOOK
43(d_os_versions,
44 "Similarly to @code{TARGET_D_CPU_VERSIONS}, but is used for versions\n\
45relating to the target operating system.",
46 void, (void),
47 hook_void_void)
48
49/* The sizeof CRITICAL_SECTION or pthread_mutex_t.  */
50DEFHOOK
51(d_critsec_size,
52 "Returns the size of the data structure used by the target operating system\n\
53for critical sections and monitors.  For example, on Microsoft Windows this\n\
54would return the @code{sizeof(CRITICAL_SECTION)}, while other platforms that\n\
55implement pthreads would return @code{sizeof(pthread_mutex_t)}.",
56 unsigned, (void),
57 hook_uint_void_0)
58
59/* Close the 'struct gcc_targetdm' definition.  */
60HOOK_VECTOR_END (C90_EMPTY_HACK)
61