 |
Blender
V2.93
|
Go to the documentation of this file.
23 #ifndef __BUILD_CONFIG_H__
24 #define __BUILD_CONFIG_H__
46 #if defined(__native_client__)
52 # if defined(__native_client_nonsfi__)
53 # define OS_NACL_NONSFI
59 #elif defined(ANDROID)
61 #elif defined(__APPLE__)
65 # include <TargetConditionals.h>
67 # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
70 #elif defined(__HAIKU__)
74 #elif defined(__linux__)
78 # if defined(__GLIBC__) && !defined(__UCLIBC__)
86 #elif defined(__Fuchsia__)
88 #elif defined(__FreeBSD__)
90 #elif defined(__NetBSD__)
92 #elif defined(__OpenBSD__)
96 #elif defined(__QNXNTO__)
98 #elif defined(__asmjs__) || defined(__wasm__)
101 # error Please add support for your platform in build_config.h
107 #if !defined(OS_ASMJS)
110 #if !defined(OS_NACL)
113 #if !defined(OS_NACL_NONSFI)
114 # define OS_NACL_NONSFI 0
116 #if !defined(OS_NACL_SFI)
117 # define OS_NACL_SFI 0
119 #if !defined(OS_ANDROID)
120 # define OS_ANDROID 0
122 #if !defined(OS_MACOSX)
128 #if !defined(OS_HAIKU)
131 #if !defined(OS_HPUX)
134 #if !defined(OS_IRIX)
137 #if !defined(OS_LINUX)
140 #if !defined(LIBC_GLIBC)
141 # define LIBC_GLIBC 0
146 #if !defined(OS_FUCHSIA)
147 # define OS_FUCHSIA 0
149 #if !defined(OS_FREEBSD)
150 # define OS_FREEBSD 0
152 #if !defined(OS_NETBSD)
155 #if !defined(OS_OPENBSD)
156 # define OS_OPENBSD 0
158 #if !defined(OS_SOLARIS)
159 # define OS_SOLARIS 0
170 #if OS_FREEBSD || OS_OPENBSD || OS_NETBSD
181 #if OS_AIX || OS_ANDROID || OS_ASMJS || OS_FREEBSD || OS_LINUX || OS_MACOSX || \
182 OS_NACL || OS_NETBSD || OS_OPENBSD || OS_QNX || OS_SOLARIS
191 #if defined(__clang__)
192 # define COMPILER_CLANG 1
193 #elif defined(__GNUC__)
194 # define COMPILER_GCC 1
195 # define COMPILER_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
196 #elif defined(_MSC_VER)
197 # define COMPILER_MSVC 1
198 # define COMPILER_MSVC_VERSION (_MSC_VER)
199 #elif defined(__MINGW32__)
200 # define COMPILER_MINGW32 1
201 #elif defined(__MINGW64__)
202 # define COMPILER_MINGW64 1
204 # error Please add support for your compiler in build_config.h
207 #if !defined(COMPILER_CLANG)
208 # define COMPILER_CLANG 0
210 #if !defined(COMPILER_GCC)
211 # define COMPILER_GCC 0
213 #if !defined(COMPILER_MSVC)
214 # define COMPILER_MSVC 0
216 #if !defined(COMPILER_MINGW32)
217 # define COMPILER_MINGW32 0
219 #if !defined(COMPILER_MINGW64)
220 # define COMPILER_MINGW64 0
224 #if COMPILER_MINGW32 || COMPILER_MINGW64
225 # define COMPILER_MINGW 1
227 # define COMPILER_MINGW 0
237 #if ((defined(__cplusplus) && (__cplusplus > 199711L)) || \
238 (defined(_MSC_VER) && (_MSC_VER >= 1800)))
239 # define COMPILER_SUPPORTS_CXX11 1
241 # define COMPILER_SUPPORTS_CXX11 0
244 #if (defined(__cplusplus) && (__cplusplus > 201311L))
245 # define COMPILER_SUPPORTS_CXX14 1
247 # define COMPILER_SUPPORTS_CXX14 0
250 #if (defined(__cplusplus) && (__cplusplus > 201611L))
251 # define COMPILER_SUPPORTS_CXX17 1
253 # define COMPILER_SUPPORTS_CXX17 0
256 #if (defined(__cplusplus) && (__cplusplus > 201911L))
257 # define COMPILER_SUPPORTS_CXX20 1
259 # define COMPILER_SUPPORTS_CXX20 0
266 #if !defined(COMPILER_USE_ADDRESS_SANITIZER)
267 # if defined(__has_feature)
268 # define COMPILER_USE_ADDRESS_SANITIZER 1
269 # elif defined(__SANITIZE_ADDRESS__)
270 # define COMPILER_USE_ADDRESS_SANITIZER 1
274 #if !defined(COMPILER_USE_ADDRESS_SANITIZER)
275 # define COMPILER_USE_ADDRESS_SANITIZER 0
287 #if defined(_M_X64) || defined(__x86_64__)
288 # define ARCH_CPU_X86_FAMILY 1
289 # define ARCH_CPU_X86_64 1
290 # define ARCH_CPU_64_BITS 1
291 # define ARCH_CPU_LITTLE_ENDIAN 1
292 #elif defined(_M_IX86) || defined(__i386__)
293 # define ARCH_CPU_X86_FAMILY 1
294 # define ARCH_CPU_X86 1
295 # define ARCH_CPU_32_BITS 1
296 # define ARCH_CPU_LITTLE_ENDIAN 1
297 #elif defined(__s390x__)
298 # define ARCH_CPU_S390_FAMILY 1
299 # define ARCH_CPU_S390X 1
300 # define ARCH_CPU_64_BITS 1
301 # define ARCH_CPU_BIG_ENDIAN 1
302 #elif defined(__s390__)
303 # define ARCH_CPU_S390_FAMILY 1
304 # define ARCH_CPU_S390 1
305 # define ARCH_CPU_31_BITS 1
306 # define ARCH_CPU_BIG_ENDIAN 1
307 #elif (defined(__PPC64__) || defined(__PPC__)) && defined(__BIG_ENDIAN__)
308 # define ARCH_CPU_PPC64_FAMILY 1
309 # define ARCH_CPU_PPC64 1
310 # define ARCH_CPU_64_BITS 1
311 # define ARCH_CPU_BIG_ENDIAN 1
312 #elif defined(__PPC64__)
313 # define ARCH_CPU_PPC64_FAMILY 1
314 # define ARCH_CPU_PPC64 1
315 # define ARCH_CPU_64_BITS 1
316 # define ARCH_CPU_LITTLE_ENDIAN 1
317 #elif defined(__ARMEL__)
318 # define ARCH_CPU_ARM_FAMILY 1
319 # define ARCH_CPU_ARMEL 1
320 # define ARCH_CPU_32_BITS 1
321 # define ARCH_CPU_LITTLE_ENDIAN 1
322 #elif defined(__aarch64__) || defined(_M_ARM64)
323 # define ARCH_CPU_ARM_FAMILY 1
324 # define ARCH_CPU_ARM64 1
325 # define ARCH_CPU_64_BITS 1
326 # define ARCH_CPU_LITTLE_ENDIAN 1
327 #elif defined(__pnacl__) || defined(__asmjs__) || defined(__wasm__)
328 # define ARCH_CPU_32_BITS 1
329 # define ARCH_CPU_LITTLE_ENDIAN 1
330 #elif defined(__MIPSEL__)
331 # if defined(__LP64__)
332 # define ARCH_CPU_MIPS_FAMILY 1
333 # define ARCH_CPU_MIPS64EL 1
334 # define ARCH_CPU_64_BITS 1
335 # define ARCH_CPU_LITTLE_ENDIAN 1
337 # define ARCH_CPU_MIPS_FAMILY 1
338 # define ARCH_CPU_MIPSEL 1
339 # define ARCH_CPU_32_BITS 1
340 # define ARCH_CPU_LITTLE_ENDIAN 1
342 #elif defined(__MIPSEB__)
343 # if defined(__LP64__)
344 # define ARCH_CPU_MIPS_FAMILY 1
345 # define ARCH_CPU_MIPS64 1
346 # define ARCH_CPU_64_BITS 1
347 # define ARCH_CPU_BIG_ENDIAN 1
349 # define ARCH_CPU_MIPS_FAMILY 1
350 # define ARCH_CPU_MIPS 1
351 # define ARCH_CPU_32_BITS 1
352 # define ARCH_CPU_BIG_ENDIAN 1
355 # error Please add support for your architecture in build_config.h
358 #if !defined(ARCH_CPU_LITTLE_ENDIAN)
359 # define ARCH_CPU_LITTLE_ENDIAN 0
361 #if !defined(ARCH_CPU_BIG_ENDIAN)
362 # define ARCH_CPU_BIG_ENDIAN 0
365 #if !defined(ARCH_CPU_32_BITS)
366 # define ARCH_CPU_32_BITS 0
368 #if !defined(ARCH_CPU_64_BITS)
369 # define ARCH_CPU_64_BITS 0
372 #if !defined(ARCH_CPU_X86_FAMILY)
373 # define ARCH_CPU_X86_FAMILY 0
375 #if !defined(ARCH_CPU_ARM_FAMILY)
376 # define ARCH_CPU_ARM_FAMILY 0
378 #if !defined(ARCH_CPU_MIPS_FAMILY)
379 # define ARCH_CPU_MIPS_FAMILY 0
381 #if !defined(ARCH_CPU_PPC64_FAMILY)
382 # define ARCH_CPU_PPC64_FAMILY 0
384 #if !defined(ARCH_CPU_S390_FAMILY)
385 # define ARCH_CPU_S390_FAMILY 0
391 #if defined(__SIZEOF_POINTER__)
392 # define PLATFORM_SIZEOF_PTR __SIZEOF_POINTER__
393 #elif defined(UINTPTR_MAX)
394 # if (UINTPTR_MAX == 0xffffffff)
395 # define PLATFORM_SIZEOF_PTR 4
396 # elif (UINTPTR_MAX == 0xffffffffffffffff)
397 # define PLATFORM_SIZEOF_PTR 8
399 #elif defined(__WORDSIZE)
400 # if (__WORDSIZE == 32)
401 # define PLATFORM_SIZEOF_PTR 4
402 # else if (__WORDSIZE == 64)
403 # define PLATFORM_SIZEOF_PTR 8
406 #if !defined(PLATFORM_SIZEOF_PTR)
407 # error Cannot find pointer size.
410 #if (UINT_MAX == 0xffffffff)
411 # define PLATFORM_SIZEOF_INT 4
412 #elif (UINT_MAX == 0xffffffffffffffff)
413 # define PLATFORM_SIZEOF_INT 8
415 # error Cannot find "int" size.
418 #if (USHRT_MAX == 0xffffffff)
419 # define PLATFORM_SIZEOF_SHORT 4
420 #elif (USHRT_MAX == 0xffff)
421 # define PLATFORM_SIZEOF_SHORT 2
423 # error Cannot find "short" size.