Skip to content

Commit

Permalink
fixed _Float16 erroneously supported on g++ (closes #57)
Browse files Browse the repository at this point in the history
  • Loading branch information
marzer committed Sep 1, 2020
1 parent 977cfbb commit 1f9b6c8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion include/toml++/toml_preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ is no longer necessary.
#if (TOML_ARM && TOML_GCC) || TOML_CLANG
#define TOML_FP16 __fp16
#endif
#if TOML_ARM && (TOML_GCC || TOML_CLANG)
#if TOML_ARM && TOML_CLANG // not present in g++
#define TOML_FLOAT16 _Float16
#endif
#endif
Expand Down
25 changes: 0 additions & 25 deletions tests/impl_toml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,6 @@
#include "../include/toml++/toml.h"
#endif

#if defined(TOML_FP16) ^ SHOULD_HAVE_FP16
#error TOML_FP16 was not deduced correctly
#endif
#if defined(TOML_FLOAT16) ^ SHOULD_HAVE_FLOAT16
#error TOML_FLOAT16 was not deduced correctly
#endif
#if defined(TOML_FLOAT128) ^ SHOULD_HAVE_FLOAT128
#error TOML_FLOAT128 was not deduced correctly
#endif
#if defined(TOML_INT128) ^ SHOULD_HAVE_INT128
#error TOML_INT128 was not deduced correctly
#endif
#if defined(TOML_INT128) ^ defined(TOML_UINT128)
#error TOML_INT128 and TOML_UINT128 must both be defined, or neither be defined
#endif
#if TOML_COMPILER_EXCEPTIONS != SHOULD_HAVE_EXCEPTIONS
#error TOML_COMPILER_EXCEPTIONS was not deduced correctly
#endif
#if TOML_COMPILER_EXCEPTIONS != TOML_EXCEPTIONS
#error TOML_EXCEPTIONS does not match TOML_COMPILER_EXCEPTIONS (default behaviour should be to match)
#endif
#if (defined(_WIN32) && !TOML_WINDOWS_COMPAT) || (!defined(_WIN32) && TOML_WINDOWS_COMPAT)
#error TOML_WINDOWS_COMPAT does not match _WIN32 (default behaviour should be to match)
#endif

namespace toml
{
using std::declval;
Expand Down
24 changes: 24 additions & 0 deletions tests/tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,30 @@
#else
#include "../include/toml++/toml.h"
#endif
#if defined(TOML_FP16) ^ SHOULD_HAVE_FP16
#error TOML_FP16 was not deduced correctly
#endif
#if defined(TOML_FLOAT16) ^ SHOULD_HAVE_FLOAT16
#error TOML_FLOAT16 was not deduced correctly
#endif
#if defined(TOML_FLOAT128) ^ SHOULD_HAVE_FLOAT128
#error TOML_FLOAT128 was not deduced correctly
#endif
#if defined(TOML_INT128) ^ SHOULD_HAVE_INT128
#error TOML_INT128 was not deduced correctly
#endif
#if defined(TOML_INT128) ^ defined(TOML_UINT128)
#error TOML_INT128 and TOML_UINT128 must both be defined, or neither be defined
#endif
#if TOML_COMPILER_EXCEPTIONS != SHOULD_HAVE_EXCEPTIONS
#error TOML_COMPILER_EXCEPTIONS was not deduced correctly
#endif
#if TOML_COMPILER_EXCEPTIONS != TOML_EXCEPTIONS
#error TOML_EXCEPTIONS does not match TOML_COMPILER_EXCEPTIONS (default behaviour should be to match)
#endif
#if (defined(_WIN32) && !TOML_WINDOWS_COMPAT) || (!defined(_WIN32) && TOML_WINDOWS_COMPAT)
#error TOML_WINDOWS_COMPAT does not match _WIN32 (default behaviour should be to match)
#endif

#if TOML_ICC
#define UNICODE_LITERALS_OK 0
Expand Down

0 comments on commit 1f9b6c8

Please sign in to comment.