2 * Copyright © 2009 CNRS
3 * Copyright © 2009-2014 Inria. All rights reserved.
4 * Copyright © 2009-2012 Université Bordeaux
5 * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
6 * See COPYING in top-level directory.
9 /* The configuration file */
11 #ifndef HWLOC_CONFIG_H
12 #define HWLOC_CONFIG_H
14 #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
15 # define __hwloc_restrict __restrict
17 # if __STDC_VERSION__ >= 199901L
18 # define __hwloc_restrict restrict
20 # define __hwloc_restrict
24 /* Note that if we're compiling C++, then just use the "inline"
25 keyword, since it's part of C++ */
26 #if defined(c_plusplus) || defined(__cplusplus)
27 # define __hwloc_inline inline
28 #elif defined(_MSC_VER) || defined(__HP_cc)
29 # define __hwloc_inline __inline
31 # define __hwloc_inline __inline__
35 * Note: this is public. We can not assume anything from the compiler used
36 * by the application and thus the HWLOC_HAVE_* macros below are not
37 * fetched from the autoconf result here. We only automatically use a few
38 * well-known easy cases.
41 /* Some handy constants to make the logic below a little more readable */
42 #if defined(__cplusplus) && \
43 (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR >= 4))
44 #define GXX_ABOVE_3_4 1
46 #define GXX_ABOVE_3_4 0
49 #if !defined(__cplusplus) && \
50 (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
51 #define GCC_ABOVE_2_95 1
53 #define GCC_ABOVE_2_95 0
56 #if !defined(__cplusplus) && \
57 (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
58 #define GCC_ABOVE_2_96 1
60 #define GCC_ABOVE_2_96 0
63 #if !defined(__cplusplus) && \
64 (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
65 #define GCC_ABOVE_3_3 1
67 #define GCC_ABOVE_3_3 0
70 /* Maybe before gcc 2.95 too */
71 #ifdef HWLOC_HAVE_ATTRIBUTE_UNUSED
72 #define __HWLOC_HAVE_ATTRIBUTE_UNUSED HWLOC_HAVE_ATTRIBUTE_UNUSED
73 #elif defined(__GNUC__)
74 # define __HWLOC_HAVE_ATTRIBUTE_UNUSED (GXX_ABOVE_3_4 || GCC_ABOVE_2_95)
76 # define __HWLOC_HAVE_ATTRIBUTE_UNUSED 0
78 #if __HWLOC_HAVE_ATTRIBUTE_UNUSED
79 # define __hwloc_attribute_unused __attribute__((__unused__))
81 # define __hwloc_attribute_unused
84 #ifdef HWLOC_HAVE_ATTRIBUTE_MALLOC
85 #define __HWLOC_HAVE_ATTRIBUTE_MALLOC HWLOC_HAVE_ATTRIBUTE_MALLOC
86 #elif defined(__GNUC__)
87 # define __HWLOC_HAVE_ATTRIBUTE_MALLOC (GXX_ABOVE_3_4 || GCC_ABOVE_2_96)
89 # define __HWLOC_HAVE_ATTRIBUTE_MALLOC 0
91 #if __HWLOC_HAVE_ATTRIBUTE_MALLOC
92 # define __hwloc_attribute_malloc __attribute__((__malloc__))
94 # define __hwloc_attribute_malloc
97 #ifdef HWLOC_HAVE_ATTRIBUTE_CONST
98 #define __HWLOC_HAVE_ATTRIBUTE_CONST HWLOC_HAVE_ATTRIBUTE_CONST
99 #elif defined(__GNUC__)
100 # define __HWLOC_HAVE_ATTRIBUTE_CONST (GXX_ABOVE_3_4 || GCC_ABOVE_2_95)
102 # define __HWLOC_HAVE_ATTRIBUTE_CONST 0
104 #if __HWLOC_HAVE_ATTRIBUTE_CONST
105 # define __hwloc_attribute_const __attribute__((__const__))
107 # define __hwloc_attribute_const
110 #ifdef HWLOC_HAVE_ATTRIBUTE_PURE
111 #define __HWLOC_HAVE_ATTRIBUTE_PURE HWLOC_HAVE_ATTRIBUTE_PURE
112 #elif defined(__GNUC__)
113 # define __HWLOC_HAVE_ATTRIBUTE_PURE (GXX_ABOVE_3_4 || GCC_ABOVE_2_96)
115 # define __HWLOC_HAVE_ATTRIBUTE_PURE 0
117 #if __HWLOC_HAVE_ATTRIBUTE_PURE
118 # define __hwloc_attribute_pure __attribute__((__pure__))
120 # define __hwloc_attribute_pure
123 #ifndef __hwloc_attribute_deprecated /* allow the user to disable these warnings by defining this macro to nothing */
124 #ifdef HWLOC_HAVE_ATTRIBUTE_DEPRECATED
125 #define __HWLOC_HAVE_ATTRIBUTE_DEPRECATED HWLOC_HAVE_ATTRIBUTE_DEPRECATED
126 #elif defined(__GNUC__)
127 # define __HWLOC_HAVE_ATTRIBUTE_DEPRECATED (GXX_ABOVE_3_4 || GCC_ABOVE_3_3)
129 # define __HWLOC_HAVE_ATTRIBUTE_DEPRECATED 0
131 #if __HWLOC_HAVE_ATTRIBUTE_DEPRECATED
132 # define __hwloc_attribute_deprecated __attribute__((__deprecated__))
134 # define __hwloc_attribute_deprecated
138 #ifdef HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS
139 #define __HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS
140 #elif defined(__GNUC__)
141 # define __HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS (GXX_ABOVE_3_4 || GCC_ABOVE_3_3)
143 # define __HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS 0
145 #if __HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS
146 # define __hwloc_attribute_may_alias __attribute__((__may_alias__))
148 # define __hwloc_attribute_may_alias
151 #ifdef HWLOC_C_HAVE_VISIBILITY
152 # if HWLOC_C_HAVE_VISIBILITY
153 # define HWLOC_DECLSPEC __attribute__((__visibility__("default")))
155 # define HWLOC_DECLSPEC
158 # define HWLOC_DECLSPEC
161 /* Defined to 1 on Linux */
162 #undef HWLOC_LINUX_SYS
164 /* Defined to 1 if the CPU_SET macro works */
165 #undef HWLOC_HAVE_CPU_SET
167 /* Defined to 1 if you have the `windows.h' header. */
168 #undef HWLOC_HAVE_WINDOWS_H
170 #undef hwloc_thread_t
172 #ifdef HWLOC_HAVE_WINDOWS_H
174 # include <windows.h>
175 typedef DWORDLONG hwloc_uint64_t
;
177 #else /* HWLOC_HAVE_WINDOWS_H */
179 # ifdef hwloc_thread_t
180 # include <pthread.h>
181 # endif /* hwloc_thread_t */
183 /* Defined to 1 if you have the <stdint.h> header file. */
184 # undef HWLOC_HAVE_STDINT_H
187 # ifdef HWLOC_HAVE_STDINT_H
190 typedef uint64_t hwloc_uint64_t
;
192 #endif /* HWLOC_HAVE_WINDOWS_H */
194 /* Whether we need to re-define all the hwloc public symbols or not */
195 #undef HWLOC_SYM_TRANSFORM
197 /* The hwloc symbol prefix */
198 #undef HWLOC_SYM_PREFIX
200 /* The hwloc symbol prefix in all caps */
201 #undef HWLOC_SYM_PREFIX_CAPS
203 #endif /* HWLOC_CONFIG_H */