main.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef BOOL_PROP1
  2. #error Expected BOOL_PROP1
  3. #endif
  4. #ifndef BOOL_PROP2
  5. #error Expected BOOL_PROP2
  6. #endif
  7. #ifndef BOOL_PROP3
  8. #error Expected BOOL_PROP3
  9. #endif
  10. #ifndef STRING_PROP1
  11. #error Expected STRING_PROP1
  12. #endif
  13. #ifndef STRING_PROP2
  14. #error Expected STRING_PROP2
  15. #endif
  16. #ifndef STRING_PROP3
  17. #error Expected STRING_PROP3
  18. #endif
  19. template <bool test>
  20. struct CMakeStaticAssert;
  21. template <>
  22. struct CMakeStaticAssert<true>
  23. {
  24. };
  25. enum
  26. {
  27. NumericMaxTest1 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP1 == 100>),
  28. NumericMaxTest2 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP2 == 250>),
  29. NumericMinTest1 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP1 == 50>),
  30. NumericMinTest2 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP2 == 200>),
  31. NumericMinTest3 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP3 == 0xA>),
  32. NumericMinTest4 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP4 == 0x10>)
  33. };
  34. #include "iface2.h"
  35. int foo();
  36. #ifdef _WIN32
  37. __declspec(dllimport)
  38. #endif
  39. int bar();
  40. int main(int argc, char** argv)
  41. {
  42. Iface2 if2;
  43. return if2.foo() + foo() + bar();
  44. }