main.cc (2394B)
1 #include <clap/all.h> 2 3 // The purpose of this file is to check that all headers compile 4 5 #if CLAP_VERSION_LT(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION) 6 #error CLAP_VERSION_LT is inconsistent 7 #endif 8 9 #if !CLAP_VERSION_EQ(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION) 10 #error CLAP_VERSION_EQ is inconsistent 11 #endif 12 13 #if CLAP_VERSION_EQ(CLAP_VERSION_MAJOR + 1, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION) 14 #error CLAP_VERSION_EQ is inconsistent (MAJOR) 15 #endif 16 #if CLAP_VERSION_EQ(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR + 1, CLAP_VERSION_REVISION) 17 #error CLAP_VERSION_EQ is inconsistent (MINOR) 18 #endif 19 #if CLAP_VERSION_EQ(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION + 1) 20 #error CLAP_VERSION_EQ is inconsistent (REVISION) 21 #endif 22 23 #if !CLAP_VERSION_GE(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION) 24 #error CLAP_VERSION_GE is inconsistent 25 #endif 26 27 #if CLAP_VERSION_LT(1,1,5) 28 #error CLAP_VERSION_GE was inroduced in 1.1.5 so we should be later than that version. 29 #endif 30 31 #if !CLAP_VERSION_LT(CLAP_VERSION_MAJOR + 1, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION) 32 #error CLAP_VERSION_LT is inconsistent (MAJOR) 33 #endif 34 #if !CLAP_VERSION_LT(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR + 1, CLAP_VERSION_REVISION) 35 #error CLAP_VERSION_LT is inconsistent (MINOR) 36 #endif 37 #if !CLAP_VERSION_LT(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION + 1) 38 #error CLAP_VERSION_LT is inconsistent (REVISION) 39 #endif 40 41 #if CLAP_VERSION_LT(CLAP_VERSION_MAJOR - 1, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION) 42 #error CLAP_VERSION_LT is inconsistent (MAJOR) 43 #endif 44 #if CLAP_VERSION_LT(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR - 1, CLAP_VERSION_REVISION) 45 #error CLAP_VERSION_LT is inconsistent (MINOR) 46 #endif 47 #if CLAP_VERSION_LT(CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION - 1) 48 #error CLAP_VERSION_LT is inconsistent (REVISION) 49 #endif 50 51 #if (CLAP_COMPILE_TEST_CXX_VERSION >= 11) && ! defined(CLAP_HAS_CXX11) 52 #error CLAP_HAS_CXX11 is not defined correctly 53 #endif 54 55 #if (CLAP_COMPILE_TEST_CXX_VERSION >= 17) && ! defined(CLAP_HAS_CXX17) 56 #error CLAP_HAS_CXX17 is not defined correctly 57 #endif 58 59 #if (CLAP_COMPILE_TEST_CXX_VERSION >= 20) && ! defined(CLAP_HAS_CXX20) 60 #error CLAP_HAS_CXX20 is not defined correctly 61 #endif 62 63 static const CLAP_CONSTEXPR clap_version m = CLAP_VERSION; 64 65 int main(int, char **) { 66 return !clap_version_is_compatible(m); 67 }