main.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. #ifndef STATIC1_BOOL_PROP1
  20. # error Expected STATIC1_BOOL_PROP1
  21. #endif
  22. #ifndef STATIC1_STRING_PROP1
  23. # error Expected STATIC1_STRING_PROP1
  24. #endif
  25. #ifndef STATIC1_NUMBER_MAX_PROP3
  26. # error Expected STATIC1_NUMBER_MAX_PROP3
  27. #endif
  28. #ifndef STATIC1_NUMBER_MIN_PROP5
  29. # error Expected STATIC1_NUMBER_MIN_PROP5
  30. #endif
  31. #ifdef OBJECT1_BOOL_PROP1
  32. # error Unexpected OBJECT1_BOOL_PROP1
  33. #endif
  34. #ifdef OBJECT1_STRING_PROP1
  35. # error Unexpected OBJECT1_STRING_PROP1
  36. #endif
  37. #ifdef OBJECT1_NUMBER_MAX_PROP3
  38. # error Unexpected OBJECT1_NUMBER_MAX_PROP3
  39. #endif
  40. #ifdef OBJECT1_NUMBER_MIN_PROP5
  41. # error Unexpected OBJECT1_NUMBER_MIN_PROP5
  42. #endif
  43. #ifdef IFACE3_BOOL_PROP1
  44. # error Unexpected IFACE3_BOOL_PROP1
  45. #endif
  46. #ifdef IFACE3_STRING_PROP1
  47. # error Unexpected IFACE3_STRING_PROP1
  48. #endif
  49. #ifdef IFACE3_NUMBER_MAX_PROP3
  50. # error Unexpected IFACE3_NUMBER_MAX_PROP3
  51. #endif
  52. #ifdef IFACE3_NUMBER_MIN_PROP5
  53. # error Unexpected IFACE3_NUMBER_MIN_PROP5
  54. #endif
  55. #ifndef STATIC1_BOOL_PROP5
  56. # error Expected STATIC1_BOOL_PROP5
  57. #endif
  58. #ifndef STATIC1_STRING_PROP4
  59. # error Expected STATIC1_STRING_PROP4
  60. #endif
  61. #ifndef STATIC1_NUMBER_MIN_PROP6
  62. # error Expected STATIC1_NUMBER_MIN_PROP6
  63. #endif
  64. #ifndef STATIC1_NUMBER_MAX_PROP4
  65. # error Expected STATIC1_NUMBER_MAX_PROP4
  66. #endif
  67. #ifndef OBJECT1_BOOL_PROP5
  68. # error Expected OBJECT1_BOOL_PROP5
  69. #endif
  70. #ifndef OBJECT1_STRING_PROP4
  71. # error Expected OBJECT1_STRING_PROP4
  72. #endif
  73. #ifndef OBJECT1_NUMBER_MIN_PROP6
  74. # error Expected OBJECT1_NUMBER_MIN_PROP6
  75. #endif
  76. #ifndef OBJECT1_NUMBER_MAX_PROP4
  77. # error Expected OBJECT1_NUMBER_MAX_PROP4
  78. #endif
  79. #ifndef IFACE3_BOOL_PROP5
  80. # error Expected IFACE3_BOOL_PROP5
  81. #endif
  82. #ifndef IFACE3_STRING_PROP4
  83. # error Expected IFACE3_STRING_PROP4
  84. #endif
  85. #ifndef IFACE3_NUMBER_MIN_PROP6
  86. # error Expected IFACE3_NUMBER_MIN_PROP6
  87. #endif
  88. #ifndef IFACE3_NUMBER_MAX_PROP4
  89. # error Expected IFACE3_NUMBER_MAX_PROP4
  90. #endif
  91. template <bool test>
  92. struct CMakeStaticAssert;
  93. template <>
  94. struct CMakeStaticAssert<true>
  95. {
  96. };
  97. enum
  98. {
  99. NumericMaxTest1 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP1 == 100>),
  100. NumericMaxTest2 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP2 == 250>),
  101. NumericMaxTest3 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP3 == 3>),
  102. NumericMinTest1 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP1 == 50>),
  103. NumericMinTest2 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP2 == 200>),
  104. NumericMinTest3 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP3 == 0xA>),
  105. NumericMinTest4 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP4 == 0x10>),
  106. NumericMinTest5 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP5 == 5>)
  107. };
  108. #include "iface2.h"
  109. int foo();
  110. #ifdef _WIN32
  111. __declspec(dllimport)
  112. #endif
  113. int bar();
  114. int main(int argc, char** argv)
  115. {
  116. Iface2 if2;
  117. return if2.foo() + foo() + bar();
  118. }