TestEABase.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) Electronic Arts Inc. All rights reserved.
  3. /////////////////////////////////////////////////////////////////////////////
  4. #include <EABase/eabase.h>
  5. #include <EABase/version.h>
  6. // What we do here is verify that EA_PRAGMA_ONCE_SUPPORTED works as intended.
  7. // This header file should be #included two times by TestEABase.cpp
  8. // in order to test this.
  9. #if defined(EA_PRAGMA_ONCE_SUPPORTED)
  10. #pragma once
  11. const int EABaseOncePerTranslationUnitTestVariable = 0; // This should get compiled only once ever for a compilation unit.
  12. #else
  13. // Just implement a classic manual header include guard.
  14. // In this case we aren't really testing anything.
  15. #ifndef TESTEABASE_H
  16. #define TESTEABASE_H
  17. const int EABaseOncePerTranslationUnitTestVariable = 0;
  18. #endif
  19. #endif
  20. // EA_EXTERN_TEMPLATE / EA_COMPILER_NO_EXTERN_TEMPLATE
  21. #if defined(__cplusplus)
  22. template <typename T>
  23. struct eabase_template
  24. {
  25. T value;
  26. T GetValue() const { return value; }
  27. };
  28. EA_EXTERN_TEMPLATE(struct eabase_template<char>);
  29. #endif