1 /* include/llvm/Config/abi-breaking.h.  Generated from abi-breaking.h.in by configure.  */
2 /*===------- llvm/Config/abi-breaking.h - llvm configuration -------*- C -*-===*/
3 /*                                                                            */
4 /*                     The LLVM Compiler Infrastructure                       */
5 /*                                                                            */
6 /* This file is distributed under the University of Illinois Open Source      */
7 /* License. See LICENSE.TXT for details.                                      */
8 /*                                                                            */
9 /*===----------------------------------------------------------------------===*/
10 
11 /* This file controls the C++ ABI break introduced in LLVM public header. */
12 
13 #ifndef LLVM_ABI_BREAKING_CHECKS_H
14 #define LLVM_ABI_BREAKING_CHECKS_H
15 
16 /* Define to enable checks that alter the LLVM C++ ABI */
17 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
18 
19 // ABI_BREAKING_CHECKS protection: provides link-time failure when clients build
20 // mismatch with LLVM
21 #if defined(_MSC_VER)
22 // Use pragma with MSVC
23 #define LLVM_XSTR(s) LLVM_STR(s)
24 #define LLVM_STR(s) #s
25 #pragma detect_mismatch("LLVM_ENABLE_ABI_BREAKING_CHECKS", LLVM_XSTR(LLVM_ENABLE_ABI_BREAKING_CHECKS))
26 /* #undef LLVM_XSTR */
27 /* #undef LLVM_STR */
28 #elif defined(_WIN32) || defined(__CYGWIN__) // Win32 w/o #pragma detect_mismatch
29 // FIXME: Implement checks without weak.
30 #elif defined(__cplusplus)
31 namespace llvm {
32 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
33 extern int EnableABIBreakingChecks;
34 __attribute__((weak, visibility ("hidden"))) int *VerifyEnableABIBreakingChecks = &EnableABIBreakingChecks;
35 #else
36 extern int DisableABIBreakingChecks;
37 __attribute__((weak, visibility ("hidden"))) int *VerifyDisableABIBreakingChecks = &DisableABIBreakingChecks;
38 #endif
39 }
40 #endif // _MSC_VER
41 
42 #endif
43