LAL  7.5.0.1-8083555
LALStddef.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2014, 2020 Karl Wette
3 * Copyright (C) 2013 Jolien Creighton
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with with program; see the file COPYING. If not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301 USA
19 */
20 
21 #ifndef _LALSTDDEF_H
22 #define _LALSTDDEF_H
23 
24 /* forbid certain definitions in LAL code */
25 #if defined(LAL_STRICT_DEFS_ENABLED)
26 # if defined(__GNUC__)
27 /* assert() is often misused for error-checking code
28  which should never be disabled in production usage */
29 # pragma GCC poison assert
30 # endif
31 #endif
32 
33 /* macros for certain keywords */
34 #if __STDC_VERSION__ >= 199901L
35 # define _LAL_RESTRICT_ restrict
36 # define _LAL_INLINE_ inline
37 #elif defined __GNUC__
38 # define _LAL_RESTRICT_ __restrict__
39 # define _LAL_INLINE_ __inline__
40 #else
41 # define _LAL_RESTRICT_
42 # define _LAL_INLINE_
43 #endif
44 
45 /* macros for compiler-specific attributes */
46 #if defined(__GNUC__)
47 # define _LAL_GCC_PRINTF_FORMAT_(NFMT, NARG) __attribute__ ((format (printf, NFMT, NARG)))
48 # define _LAL_GCC_VPRINTF_FORMAT_(NFMT) __attribute__ ((format (printf, NFMT, 0)))
49 #else
50 # define _LAL_GCC_PRINTF_FORMAT_(NFMT, NARG)
51 # define _LAL_GCC_VPRINTF_FORMAT_(NFMT)
52 #endif
53 
54 #endif /* _LALSTDDEF_H */