Skip to content

Commit

Permalink
Undef True/False in case they are defined and introduce some constexp…
Browse files Browse the repository at this point in the history
…r True/False to replace them. (#1610)
  • Loading branch information
asuessenbach authored Jul 3, 2023
1 parent c115fd1 commit d748663
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions snippets/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions vulkan/vulkan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d748663

Please sign in to comment.