exportheader_test.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #include "libshared.h"
  2. #include "libstatic.h"
  3. // #define BUILD_FAIL
  4. #ifndef BUILD_FAIL
  5. #define DOES_NOT_BUILD(function)
  6. #else
  7. #define DOES_NOT_BUILD(function) function
  8. #endif
  9. int main()
  10. {
  11. {
  12. Libshared l;
  13. l.libshared();
  14. l.libshared_exported();
  15. l.libshared_deprecated();
  16. l.libshared_not_exported();
  17. DOES_NOT_BUILD(l.libshared_excluded();)
  18. }
  19. {
  20. LibsharedNotExported l;
  21. DOES_NOT_BUILD(l.libshared();)
  22. l.libshared_exported();
  23. l.libshared_deprecated();
  24. DOES_NOT_BUILD(l.libshared_not_exported();)
  25. DOES_NOT_BUILD(l.libshared_excluded();)
  26. }
  27. {
  28. LibsharedExcluded l;
  29. DOES_NOT_BUILD(l.libshared();)
  30. l.libshared_exported();
  31. l.libshared_deprecated();
  32. DOES_NOT_BUILD(l.libshared_not_exported();)
  33. DOES_NOT_BUILD(l.libshared_excluded();)
  34. }
  35. libshared_exported();
  36. libshared_deprecated();
  37. DOES_NOT_BUILD(libshared_not_exported();)
  38. DOES_NOT_BUILD(libshared_excluded();)
  39. {
  40. Libstatic l;
  41. l.libstatic();
  42. l.libstatic_exported();
  43. l.libstatic_deprecated();
  44. l.libstatic_not_exported();
  45. l.libstatic_excluded();
  46. }
  47. {
  48. LibstaticNotExported l;
  49. l.libstatic();
  50. l.libstatic_exported();
  51. l.libstatic_deprecated();
  52. l.libstatic_not_exported();
  53. l.libstatic_excluded();
  54. }
  55. {
  56. LibstaticExcluded l;
  57. l.libstatic();
  58. l.libstatic_exported();
  59. l.libstatic_deprecated();
  60. l.libstatic_not_exported();
  61. l.libstatic_excluded();
  62. }
  63. libstatic_exported();
  64. libstatic_deprecated();
  65. libstatic_not_exported();
  66. libstatic_excluded();
  67. return 0;
  68. }