1 #ifndef __NUMPY_UTILS_HEADER__
2 #define __NUMPY_UTILS_HEADER__
3 
4 #ifndef __COMP_NPY_UNUSED
5     #if defined(__GNUC__)
6         #define __COMP_NPY_UNUSED __attribute__ ((__unused__))
7     #elif defined(__ICC)
8         #define __COMP_NPY_UNUSED __attribute__ ((__unused__))
9     #elif defined(__clang__)
10         #define __COMP_NPY_UNUSED __attribute__ ((unused))
11     #else
12         #define __COMP_NPY_UNUSED
13     #endif
14 #endif
15 
16 #if defined(__GNUC__) || defined(__ICC) || defined(__clang__)
17     #define NPY_DECL_ALIGNED(x) __attribute__ ((aligned (x)))
18 #elif defined(_MSC_VER)
19     #define NPY_DECL_ALIGNED(x) __declspec(align(x))
20 #else
21     #define NPY_DECL_ALIGNED(x)
22 #endif
23 
24 /* Use this to tag a variable as not used. It will remove unused variable
25  * warning on support platforms (see __COM_NPY_UNUSED) and mangle the variable
26  * to avoid accidental use */
27 #define NPY_UNUSED(x) (__NPY_UNUSED_TAGGED ## x) __COMP_NPY_UNUSED
28 #define NPY_EXPAND(x) x
29 
30 #define NPY_STRINGIFY(x) #x
31 #define NPY_TOSTRING(x) NPY_STRINGIFY(x)
32 
33 #define NPY_CAT__(a, b) a ## b
34 #define NPY_CAT_(a, b) NPY_CAT__(a, b)
35 #define NPY_CAT(a, b) NPY_CAT_(a, b)
36 
37 #endif
38