RedefineCompilerMacros.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // DO NOT PUT #pragma once or include guard check here
  2. // This header is designed to be able to be included multiple times
  3. // This header is used to redefine compiler macros after they were temporary undefined by UndefineCompilerMacros.h
  4. // Please make sure to always use this paired with the UndefineCompilerMacros.h header.
  5. //
  6. // ex.
  7. //
  8. // #include "UndefineCompilerMacros.h"
  9. // #include "Some3rdParty.h"
  10. // #include "RedefineCompilerMacros.h"
  11. #ifndef DETAIL__COMPILERMACROS_HAD_BEEN_UNDEFINED_BY_UNDEFINECOMPILER_H
  12. #error "RedefineCompilerMacros.h can only be used after UndefinePlatforms.h got included before."
  13. #endif
  14. #undef DETAIL__COMPILERMACROS_HAD_BEEN_UNDEFINED_BY_UNDEFINECOMPILER_H
  15. #undef COMPILER_GCC
  16. #if defined(DETAIL__TEMP_COMPILER_GCC_WAS_1)
  17. #undef DETAIL__TEMP_COMPILER_GCC_WAS_1
  18. #define COMPILER_GCC 1
  19. #else
  20. #define COMPILER_GCC 0
  21. #endif
  22. #undef COMPILER_CLANG
  23. #if defined(DETAIL__TEMP_COMPILER_CLANG_WAS_1)
  24. #undef DETAIL__TEMP_COMPILER_CLANG_WAS_1
  25. #define COMPILER_CLANG 1
  26. #else
  27. #define COMPILER_CLANG 0
  28. #endif
  29. #undef COMPILER_MSVC
  30. #if defined(DETAIL__TEMP_COMPILER_MSVC_WAS_1)
  31. #undef DETAIL__TEMP_COMPILER_MSVC_WAS_1
  32. #define COMPILER_MSVC 1
  33. #else
  34. #define COMPILER_MSVC 0
  35. #endif