fixed _Float16 erroneously supported on g++ (closes #57)

This commit is contained in:
Mark Gillard 2020-09-01 14:09:29 +03:00
parent 977cfbbf4e
commit 81d74663e8
5 changed files with 27 additions and 39 deletions

View File

@ -201,6 +201,7 @@ UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's '[
- **[@rbrugo](https://github.com/rbrugo)** - Helped design a new feature
- **[@Reedbeta](https://github.com/Reedbeta)** - Fixed a bug and added additional Visual Studio debugger native visualizers
- **[@shdnx](https://github.com/shdnx)** - Fixed a bug on GCC 8.2.0 and some meson config issues
- **[@sobczyk](https://github.com/sobczyk)** - Reported some bugs
- **[@traversaro](https://github.com/traversaro)** - Added vcpkg support and reported a bunch of bugs
- **[@ximion](https://github.com/ximion)** - Added support for installation with meson
- **[@whiterabbit963](https://github.com/whiterabbit963)** - Fixed a bug with value_or conversions

View File

@ -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

View File

@ -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;
@ -202,18 +177,6 @@ namespace toml
CHECK_VALUE_OR( TOML_UINT128&&, TOML_UINT128);
CHECK_VALUE_OR( TOML_UINT128 const, TOML_UINT128);
#endif
#ifdef TOML_FP16
CHECK_VALUE_OR( TOML_FP16, TOML_FP16);
CHECK_VALUE_OR( TOML_FP16&, TOML_FP16);
CHECK_VALUE_OR( TOML_FP16&&, TOML_FP16);
CHECK_VALUE_OR( TOML_FP16 const, TOML_FP16);
#endif
#ifdef TOML_FLOAT16
CHECK_VALUE_OR( TOML_FLOAT16, TOML_FLOAT16);
CHECK_VALUE_OR( TOML_FLOAT16&, TOML_FLOAT16);
CHECK_VALUE_OR( TOML_FLOAT16&&, TOML_FLOAT16);
CHECK_VALUE_OR( TOML_FLOAT16 const, TOML_FLOAT16);
#endif
CHECK_VALUE_OR( float, float);
CHECK_VALUE_OR( float&, float);
CHECK_VALUE_OR( float&&, float);

View File

@ -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

View File

@ -492,7 +492,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