1169695Skan/* Copyright (C) 2005 Free Software Foundation, Inc.
2169695Skan   Contributed by Jakub Jelinek <jakub@redhat.com>.
3169695Skan
4169695Skan   This file is part of the GNU OpenMP Library (libgomp).
5169695Skan
6169695Skan   Libgomp is free software; you can redistribute it and/or modify it
7169695Skan   under the terms of the GNU Lesser General Public License as published by
8169695Skan   the Free Software Foundation; either version 2.1 of the License, or
9169695Skan   (at your option) any later version.
10169695Skan
11169695Skan   Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
12169695Skan   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13169695Skan   FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
14169695Skan   more details.
15169695Skan
16169695Skan   You should have received a copy of the GNU Lesser General Public License
17169695Skan   along with libgomp; see the file COPYING.LIB.  If not, write to the
18169695Skan   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19169695Skan   MA 02110-1301, USA.  */
20169695Skan
21169695Skan/* As a special exception, if you link this library with other files, some
22169695Skan   of which are compiled with GCC, to produce an executable, this library
23169695Skan   does not by itself cause the resulting executable to be covered by the
24169695Skan   GNU General Public License.  This exception does not however invalidate
25169695Skan   any other reasons why the executable file might be covered by the GNU
26169695Skan   General Public License.  */
27169695Skan
28169695Skan/* This file contains prototypes of functions in the external ABI.
29169695Skan   This file is included by files in the testsuite.  */
30169695Skan
31169695Skan#ifndef LIBGOMP_F_H
32169695Skan#define LIBGOMP_F_H 1
33169695Skan
34169695Skan#include "libgomp.h"
35169695Skan
36169695Skan#if (@OMP_LOCK_SIZE@ == @OMP_LOCK_KIND@) \
37169695Skan    && (@OMP_LOCK_ALIGN@ <= @OMP_LOCK_SIZE@)
38169695Skan# define OMP_LOCK_DIRECT
39169695Skantypedef omp_lock_t *omp_lock_arg_t;
40169695Skan# define omp_lock_arg(arg) (arg)
41169695Skan#else
42169695Skantypedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
43169695Skan# define omp_lock_arg(arg) ((arg)->lock)
44169695Skan# endif
45169695Skan
46169695Skan#if (@OMP_NEST_LOCK_SIZE@ == @OMP_NEST_LOCK_KIND@) \
47169695Skan    && (@OMP_NEST_LOCK_ALIGN@ <= @OMP_NEST_LOCK_SIZE@)
48169695Skan# define OMP_NEST_LOCK_DIRECT
49169695Skantypedef omp_nest_lock_t *omp_nest_lock_arg_t;
50169695Skan# define omp_nest_lock_arg(arg) (arg)
51169695Skan#else
52169695Skantypedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
53169695Skan# define omp_nest_lock_arg(arg) ((arg)->lock)
54169695Skan# endif
55169695Skan
56169695Skanstatic inline void
57169695Skanomp_check_defines (void)
58169695Skan{
59169695Skan  char test[(@OMP_LOCK_SIZE@ != sizeof (omp_lock_t)
60169695Skan	     || @OMP_LOCK_ALIGN@ != __alignof (omp_lock_t)
61169695Skan	     || @OMP_NEST_LOCK_SIZE@ != sizeof (omp_nest_lock_t)
62169695Skan	     || @OMP_NEST_LOCK_ALIGN@ != __alignof (omp_nest_lock_t)
63169695Skan	     || @OMP_LOCK_KIND@ != sizeof (*(omp_lock_arg_t) 0)
64169695Skan	     || @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0))
65169695Skan	    ? -1 : 1] __attribute__ ((__unused__));
66169695Skan}
67169695Skan
68169695Skan#endif /* LIBGOMP_F_H */
69