Skip to content

Commit

Permalink
config: move ENTT_CONSTEVAL to config.h
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Jan 17, 2025
1 parent 12b0a86 commit d1abac2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 12 additions & 0 deletions src/entt/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
# define ENTT_CATCH if(false)
#endif

#if __has_include(<version>)
# include <version>
#
# if defined(__cpp_consteval)
# define ENTT_CONSTEVAL consteval
# endif
#endif

#ifndef ENTT_CONSTEVAL
# define ENTT_CONSTEVAL constexpr
#endif

#ifdef ENTT_USE_ATOMIC
# include <atomic>
# define ENTT_MAYBE_ATOMIC(Type) std::atomic<Type>
Expand Down
11 changes: 0 additions & 11 deletions src/entt/config/macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@
#define ENTT_STR(arg) #arg
#define ENTT_XSTR(arg) ENTT_STR(arg)

#define ENTT_CONSTEVAL constexpr

#if __has_include(<version>)
# include <version>
#
# if defined(__cpp_consteval)
# undef ENTT_CONSTEVAL
# define ENTT_CONSTEVAL consteval
# endif
#endif

// NOLINTEND(cppcoreguidelines-macro-usage)

#endif

0 comments on commit d1abac2

Please sign in to comment.