117721Speter/* Copyright (C) 2005 Free Software Foundation, Inc.
217721Speter   Contributed by Jakub Jelinek <jakub@redhat.com>.
317721Speter
417721Speter   This file is part of the GNU OpenMP Library (libgomp).
517721Speter
617721Speter   Libgomp is free software; you can redistribute it and/or modify it
717721Speter   under the terms of the GNU Lesser General Public License as published by
817721Speter   the Free Software Foundation; either version 2.1 of the License, or
917721Speter   (at your option) any later version.
1017721Speter
1117721Speter   Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
1217721Speter   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1317721Speter   FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
1417721Speter   more details.
1517721Speter
1617721Speter   You should have received a copy of the GNU Lesser General Public License
1717721Speter   along with libgomp; see the file COPYING.LIB.  If not, write to the
1817721Speter   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
1917721Speter   MA 02110-1301, USA.  */
2017721Speter
2117721Speter/* As a special exception, if you link this library with other files, some
2217721Speter   of which are compiled with GCC, to produce an executable, this library
2317721Speter   does not by itself cause the resulting executable to be covered by the
2417721Speter   GNU General Public License.  This exception does not however invalidate
2517721Speter   any other reasons why the executable file might be covered by the GNU
2617721Speter   General Public License.  */
2717721Speter
2817721Speter/* This file contains prototypes of functions in the external ABI.
2917721Speter   This file is included by files in the testsuite.  */
3017721Speter
3117721Speter#ifndef LIBGOMP_F_H
3217721Speter#define LIBGOMP_F_H 1
3317721Speter
3417721Speter#include "libgomp.h"
3517721Speter
3617721Speter#if (@OMP_LOCK_SIZE@ == @OMP_LOCK_KIND@) \
3717721Speter    && (@OMP_LOCK_ALIGN@ <= @OMP_LOCK_SIZE@)
3817721Speter# define OMP_LOCK_DIRECT
3917721Spetertypedef omp_lock_t *omp_lock_arg_t;
4017721Speter# define omp_lock_arg(arg) (arg)
4117721Speter#else
4217721Spetertypedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
4317721Speter# define omp_lock_arg(arg) ((arg)->lock)
4417721Speter# endif
4517721Speter
4617721Speter#if (@OMP_NEST_LOCK_SIZE@ == @OMP_NEST_LOCK_KIND@) \
4717721Speter    && (@OMP_NEST_LOCK_ALIGN@ <= @OMP_NEST_LOCK_SIZE@)
4817721Speter# define OMP_NEST_LOCK_DIRECT
4917721Spetertypedef omp_nest_lock_t *omp_nest_lock_arg_t;
5017721Speter# define omp_nest_lock_arg(arg) (arg)
5117721Speter#else
5217721Spetertypedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
5317721Speter# define omp_nest_lock_arg(arg) ((arg)->lock)
5417721Speter# endif
5517721Speter
5617721Speterstatic inline void
5717721Speteromp_check_defines (void)
5817721Speter{
5917721Speter  char test[(@OMP_LOCK_SIZE@ != sizeof (omp_lock_t)
6017721Speter	     || @OMP_LOCK_ALIGN@ != __alignof (omp_lock_t)
6117721Speter	     || @OMP_NEST_LOCK_SIZE@ != sizeof (omp_nest_lock_t)
6217721Speter	     || @OMP_NEST_LOCK_ALIGN@ != __alignof (omp_nest_lock_t)
6317721Speter	     || @OMP_LOCK_KIND@ != sizeof (*(omp_lock_arg_t) 0)
6417721Speter	     || @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0))
6517721Speter	    ? -1 : 1] __attribute__ ((__unused__));
6617721Speter}
6717721Speter
6817721Speter#endif /* LIBGOMP_F_H */
6917721Speter