LibSWIFFT  1.2.0
common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Yaron Gvili and Gvili Tech Ltd.
3  *
4  * See the accompanying LICENSE.txt file for licensing information.
5  */
6 #ifndef __LIBSWIFFT_COMMON_H__
7 #define __LIBSWIFFT_COMMON_H__
8 
13 #define LIBSWIFFT_QUOTE0(x) #x
14 #define LIBSWIFFT_QUOTE(x) LIBSWIFFT_QUOTE0(x)
15 
16 #define LIBSWIFFT_CONCAT0(x1,x2) x1##x2
17 #define LIBSWIFFT_CONCAT(x1,x2) LIBSWIFFT_CONCAT0(x1,x2)
18 
19 #define LIBSWIFFT_INLINE inline __attribute__((always_inline))
20 
21 #ifdef __cplusplus
22  #define LIBSWIFFT_BEGIN_EXTERN_C extern "C" {
23  #define LIBSWIFFT_END_EXTERN_C }
24 #else
25  #define LIBSWIFFT_BEGIN_EXTERN_C
26  #define LIBSWIFFT_END_EXTERN_C
27 #endif
28 
29 #ifdef __cplusplus
30  #define LIBSWIFFT_STATIC_ASSERT(expr, iden) static_assert(expr, LIBSWIFFT_QUOTE(iden))
31 #else
32  #define LIBSWIFFT_STATIC_ASSERT(expr, iden) typedef char LIBSWIFFT_CONCAT(libswifft_static_assert_, iden)[(expr) ? 1 : -1]
33 #endif
34 
35 #define LIBSWIFFT_RESTRICT __restrict__
36 
37 #endif /* __LIBSWIFFT_COMMON_H__ */