]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgomp/libgomp_f.h.in
OpenMP: Minor '!$omp allocators' cleanup
[thirdparty/gcc.git] / libgomp / libgomp_f.h.in
CommitLineData
83ffe9cd 1/* Copyright (C) 2005-2023 Free Software Foundation, Inc.
953ff289
DN
2 Contributed by Jakub Jelinek <jakub@redhat.com>.
3
f1f3453e
TS
4 This file is part of the GNU Offloading and Multi Processing Library
5 (libgomp).
953ff289
DN
6
7 Libgomp is free software; you can redistribute it and/or modify it
748086b7
JJ
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
953ff289
DN
11
12 Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
748086b7 14 FOR A PARTICULAR PURPOSE. See the GNU General Public License for
953ff289
DN
15 more details.
16
748086b7
JJ
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
20
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
953ff289
DN
25
26/* This file contains prototypes of functions in the external ABI.
27 This file is included by files in the testsuite. */
28
29#ifndef LIBGOMP_F_H
30#define LIBGOMP_F_H 1
31
32#include "libgomp.h"
953ff289 33
03b8fe49
PB
34#if (@OMP_LOCK_SIZE@ == @OMP_LOCK_KIND@) \
35 && (@OMP_LOCK_ALIGN@ <= @OMP_LOCK_SIZE@)
953ff289
DN
36# define OMP_LOCK_DIRECT
37typedef omp_lock_t *omp_lock_arg_t;
38# define omp_lock_arg(arg) (arg)
39#else
40typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
41# define omp_lock_arg(arg) ((arg)->lock)
42# endif
43
03b8fe49
PB
44#if (@OMP_NEST_LOCK_SIZE@ == @OMP_NEST_LOCK_KIND@) \
45 && (@OMP_NEST_LOCK_ALIGN@ <= @OMP_NEST_LOCK_SIZE@)
953ff289
DN
46# define OMP_NEST_LOCK_DIRECT
47typedef omp_nest_lock_t *omp_nest_lock_arg_t;
48# define omp_nest_lock_arg(arg) (arg)
49#else
50typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
51# define omp_nest_lock_arg(arg) ((arg)->lock)
52# endif
53
a68ab351
JJ
54#if (@OMP_LOCK_25_SIZE@ == @OMP_LOCK_25_KIND@) \
55 && (@OMP_LOCK_25_ALIGN@ <= @OMP_LOCK_25_SIZE@)
56# define OMP_LOCK_25_DIRECT
57typedef omp_lock_25_t *omp_lock_25_arg_t;
58# define omp_lock_25_arg(arg) (arg)
59#else
60typedef union { omp_lock_25_t *lock; uint64_t u; } *omp_lock_25_arg_t;
61# define omp_lock_25_arg(arg) ((arg)->lock)
62# endif
63
64#if (@OMP_NEST_LOCK_25_SIZE@ == @OMP_NEST_LOCK_25_KIND@) \
65 && (@OMP_NEST_LOCK_25_ALIGN@ <= @OMP_NEST_LOCK_25_SIZE@)
66# define OMP_NEST_LOCK_25_DIRECT
67typedef omp_nest_lock_25_t *omp_nest_lock_25_arg_t;
68# define omp_nest_lock_25_arg(arg) (arg)
69#else
70typedef union { omp_nest_lock_25_t *lock; uint64_t u; } *omp_nest_lock_25_arg_t;
71# define omp_nest_lock_25_arg(arg) ((arg)->lock)
72# endif
73
953ff289
DN
74static inline void
75omp_check_defines (void)
76{
03b8fe49
PB
77 char test[(@OMP_LOCK_SIZE@ != sizeof (omp_lock_t)
78 || @OMP_LOCK_ALIGN@ != __alignof (omp_lock_t)
79 || @OMP_NEST_LOCK_SIZE@ != sizeof (omp_nest_lock_t)
80 || @OMP_NEST_LOCK_ALIGN@ != __alignof (omp_nest_lock_t)
81 || @OMP_LOCK_KIND@ != sizeof (*(omp_lock_arg_t) 0)
2631d95a
TB
82 || @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0)
83 || @INTPTR_T_KIND@ != sizeof (omp_allocator_handle_t)
84 || 4 != sizeof (omp_alloctrait_key_t)
85 || @INTPTR_T_KIND@ != sizeof (omp_alloctrait_value_t)
86 || @INTPTR_T_KIND@ != sizeof (omp_memspace_handle_t)
87 || @OMP_DEPEND_KIND@ != sizeof (omp_depend_t))
953ff289 88 ? -1 : 1] __attribute__ ((__unused__));
a68ab351
JJ
89 char test2[(@OMP_LOCK_25_SIZE@ != sizeof (omp_lock_25_t)
90 || @OMP_LOCK_25_ALIGN@ != __alignof (omp_lock_25_t)
91 || @OMP_NEST_LOCK_25_SIZE@ != sizeof (omp_nest_lock_25_t)
92 || @OMP_NEST_LOCK_25_ALIGN@ != __alignof (omp_nest_lock_25_t)
93 || @OMP_LOCK_25_KIND@ != sizeof (*(omp_lock_25_arg_t) 0)
94 || @OMP_NEST_LOCK_25_KIND@
95 != sizeof (*(omp_nest_lock_25_arg_t) 0))
96 ? -1 : 1] __attribute__ ((__unused__));
953ff289
DN
97}
98
99#endif /* LIBGOMP_F_H */