Skip to content

Commit

Permalink
Fix module definitions for feature testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Oct 23, 2024
1 parent ca9ddb4 commit 4a3d6d5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion include/boost/crypt/utility/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@

// ----- Assertions -----
#ifndef BOOST_CRYPT_HAS_CUDA
# include <cassert>
# ifndef BOOST_CRYPT_BUILD_MODULE
# include <cassert>
# endif
# define BOOST_CRYPT_ASSERT(x) assert(x)
# define BOOST_CRYPT_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
#else
Expand All @@ -70,6 +72,9 @@

// ----- Has something -----
// C++17

#ifndef BOOST_CRYPT_BUILD_MODULE

#ifndef BOOST_CRYPT_HAS_CUDA
# if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
# if __has_include(<string_view>)
Expand All @@ -93,6 +98,14 @@
# endif // C++20
#endif // BOOST_CRYPT_HAS_CUDA

#else // We are building a module

// If someone is building the module successfully they defintiely have the above things
# define BOOST_CRYPT_HAS_STRING_VIEW
# define BOOST_CRYPT_HAS_SPAN

#endif // BOOST_CRYPT_BUILD_MODULE

#if defined(__has_builtin)
#define BOOST_CRYPT_HAS_BUILTIN(x) __has_builtin(x)
#else
Expand Down

0 comments on commit 4a3d6d5

Please sign in to comment.