Browse Source

Clean up the features.h header.

wip/core-clipp
Sam Hocevar 4 years ago
parent
commit
f0b8cfc6f2
1 changed files with 22 additions and 11 deletions
  1. +22
    -11
      include/lol/base/private/features.h

+ 22
- 11
include/lol/base/private/features.h View File

@@ -17,17 +17,34 @@
// ———————————————————————
//


// C++ compiler features detected through __has_cpp_attribute

#if defined(__has_cpp_attribute) && !__has_cpp_attribute(nodiscard)
# error C++ compiler support for [[nodiscard]] is required (use -std=c++17?)
#if defined(__has_cpp_attribute)

# if !__has_cpp_attribute(nodiscard)
# error C++ compiler support for [[nodiscard]] is required (use -std=c++17?)
# endif

# if !__has_cpp_attribute(fallthrough)
# error C++ compiler support for [[fallthrough]] is required (use -std=c++17?)
# endif

#endif

#if defined(__has_cpp_attribute) && !__has_cpp_attribute(fallthrough)
# error C++ compiler support for [[fallthrough]] is required (use -std=c++17?)

// C++ compiler features detected through __has_feature

#if defined(__has_feature)

# if !__has_feature(cxx_constexpr)
# error C++ compiler for constexpr is required (use -std=c++11?)
# endif

#endif

// Define some attribute macros.

// Define some attribute macros

#ifdef __GNUC__
# define lol_attr_printf_format(n, p) __attribute__((format(printf, n, p)))
@@ -35,9 +52,3 @@
# define lol_attr_printf_format(n, p)
#endif

#if defined(_WIN32)
# define LOL_ATTR_STDCALL __stdcall
#else
# define LOL_ATTR_STDCALL /* */
#endif


Loading…
Cancel
Save