xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/sol2-d.c (revision 4c3eb207d36f67d31994830c0a694161fc1ca39b)
1627f7eb2Smrg /* Solaris support needed only by D front-end.
2*4c3eb207Smrg    Copyright (C) 2018-2020 Free Software Foundation, Inc.
3627f7eb2Smrg 
4627f7eb2Smrg GCC is free software; you can redistribute it and/or modify it under
5627f7eb2Smrg the terms of the GNU General Public License as published by the Free
6627f7eb2Smrg Software Foundation; either version 3, or (at your option) any later
7627f7eb2Smrg version.
8627f7eb2Smrg 
9627f7eb2Smrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
10627f7eb2Smrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
11627f7eb2Smrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12627f7eb2Smrg for more details.
13627f7eb2Smrg 
14627f7eb2Smrg You should have received a copy of the GNU General Public License
15627f7eb2Smrg along with GCC; see the file COPYING3.  If not see
16627f7eb2Smrg <http://www.gnu.org/licenses/>.  */
17627f7eb2Smrg 
18627f7eb2Smrg #include "config.h"
19627f7eb2Smrg #include "system.h"
20627f7eb2Smrg #include "coretypes.h"
21627f7eb2Smrg #include "tm.h"
22627f7eb2Smrg #include "memmodel.h"
23627f7eb2Smrg #include "tm_p.h"
24627f7eb2Smrg #include "d/d-target.h"
25627f7eb2Smrg #include "d/d-target-def.h"
26627f7eb2Smrg 
27627f7eb2Smrg /* Implement TARGET_D_OS_VERSIONS for Solaris targets.  */
28627f7eb2Smrg 
29627f7eb2Smrg static void
solaris_d_os_builtins(void)30627f7eb2Smrg solaris_d_os_builtins (void)
31627f7eb2Smrg {
32627f7eb2Smrg   d_add_builtin_version ("Posix");
33627f7eb2Smrg   d_add_builtin_version ("Solaris");			\
34627f7eb2Smrg }
35627f7eb2Smrg 
36627f7eb2Smrg /* Implement TARGET_D_CRITSEC_SIZE for Solaris targets.  */
37627f7eb2Smrg 
38627f7eb2Smrg static unsigned
solaris_d_critsec_size(void)39627f7eb2Smrg solaris_d_critsec_size (void)
40627f7eb2Smrg {
41627f7eb2Smrg   /* This is the sizeof pthread_mutex_t.  */
42627f7eb2Smrg   return 24;
43627f7eb2Smrg }
44627f7eb2Smrg 
45627f7eb2Smrg #undef TARGET_D_OS_VERSIONS
46627f7eb2Smrg #define TARGET_D_OS_VERSIONS solaris_d_os_builtins
47627f7eb2Smrg 
48627f7eb2Smrg #undef TARGET_D_CRITSEC_SIZE
49627f7eb2Smrg #define TARGET_D_CRITSEC_SIZE solaris_d_critsec_size
50627f7eb2Smrg 
51627f7eb2Smrg struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;
52