Undef True/False in case they are defined and introduce some constexpr True/False to replace them. (#1610)

This commit is contained in:
Andreas Süßenbach 2023-07-03 14:34:21 +02:00 committed by GitHub
parent c115fd1ec6
commit d748663707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -14,6 +14,17 @@
# undef MemoryBarrier
#endif
// XLib.h defines True/False, which collides with our vk::True/vk::False
// -> undef them and provide some namepace-secure constexpr
#if defined( True )
# undef True
constexpr int True = 1;
#endif
#if defined( False )
# undef False
constexpr int False = 0;
#endif
#if defined(__GNUC__)
# define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ )
#endif

View File

@ -140,6 +140,17 @@ static_assert( VK_HEADER_VERSION == 256, "Wrong VK_HEADER_VERSION!" );
# undef MemoryBarrier
#endif
// XLib.h defines True/False, which collides with our vk::True/vk::False
// -> undef them and provide some namepace-secure constexpr
#if defined( True )
# undef True
constexpr int True = 1;
#endif
#if defined( False )
# undef False
constexpr int False = 0;
#endif
#if defined( __GNUC__ )
# define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ )
#endif