libgomp_f.h.in 3.5 KB

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