UndefineCompilerMacros.h 992 B

1234567891011121314151617181920212223242526272829303132
  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 temporary undefine all compiler macros in case there is a naming conflict with
  4. // 3rd party code. Please make sure to always use this paired with the RedefineCompilerMacros.h header.
  5. //
  6. // ex.
  7. //
  8. // #include "UndefineCompilerMacros.h"
  9. // #include "Some3rdParty.h"
  10. // #include "RedefineCompilerMacros.h"
  11. #ifdef DETAIL__COMPILERMACROS_HAD_BEEN_UNDEFINED_BY_UNDEFINECOMPILER_H
  12. #error "UndefineCompilerMacros.h has been included more than once or RedefineCompilerMacros.h is missing."
  13. #endif
  14. #if COMPILER_GCC
  15. #define DETAIL__TEMP_COMPILER_GCC_WAS_1
  16. #endif
  17. #undef COMPILER_GCC
  18. #if COMPILER_CLANG
  19. #define DETAIL__TEMP_COMPILER_CLANG_WAS_1
  20. #endif
  21. #undef COMPILER_CLANG
  22. #if COMPILER_MSVC
  23. #define DETAIL__TEMP_COMPILER_MSVC_WAS_1
  24. #endif
  25. #undef COMPILER_MSVC
  26. #define DETAIL__COMPILERMACROS_HAD_BEEN_UNDEFINED_BY_UNDEFINECOMPILER_H