Fixes for MSVC

This commit is contained in:
2025-07-02 14:19:05 -07:00
parent 9010650ceb
commit 9ea63478e5
22 changed files with 468 additions and 285 deletions

View File

@@ -19,6 +19,10 @@
#ifndef FENNEC_LANG_ASSERT_H
#define FENNEC_LANG_ASSERT_H
#if _MSC_VER
#define __PRETTY_FUNCTION__ __FUNCSIG__
#endif
using assert_handler = void (*)(const char *, const char *, int , const char *);
extern void __assert_impl(const char* expression, const char* file, int line, const char* function);

View File

@@ -19,9 +19,18 @@
#ifndef FENNEC_LANG_DETAIL_INT_H
#define FENNEC_LANG_DETAIL_INT_H
#if _MSC_VER
#pragma warning(push)
#pragma warning(disable:4117)
#endif
#pragma push_macro("__cplusplus")
#undef __cplusplus
#include <stdint.h>
#pragma pop_macro("__cplusplus")
#if _MSC_VER
#pragma warning(pop)
#endif
#endif // FENNEC_LANG_DETAIL_INT_H

View File

@@ -19,6 +19,11 @@
#ifndef FENNEC_LANG_DETAIL_STDLIB_H
#define FENNEC_LANG_DETAIL_STDLIB_H
#if _MSC_VER
#pragma warning(push)
#pragma warning(disable:4117)
#endif
#pragma push_macro("__cplusplus")
#undef __cplusplus
extern "C" {
@@ -26,4 +31,8 @@ extern "C" {
}
#pragma pop_macro("__cplusplus")
#if _MSC_VER
#pragma warning(pop)
#endif
#endif // FENNEC_LANG_DETAIL_STDLIB_H

View File

@@ -32,6 +32,32 @@
#include <fennec/lang/bits.h>
#undef FLT_HAS_INFINITY
#undef FLT_HAS_QUIET_NAN
#undef FLT_HAS_SIGNALING_NAN
#undef FLT_HAS_DENORM
#undef FLT_HAS_DENORM_LOSS
#undef FLT_ROUNDS
#undef FLT_IS_IEC559
#undef FLT_MANT_DIG
#undef FLT_DIG
#undef FLT_DECIMAL_DIG
#undef FLT_RADIX
#undef FLT_MIN_EXP
#undef FLT_MAX_EXP
#undef FLT_MIN_10_EXP
#undef FLT_MAX_10_EXP
#undef FLT_TRAPS
#undef FLT_TINYNESS_BEFORE
#undef FLT_MIN
#undef FLT_MAX
#undef FLT_EPSILON
#undef FLT_INF
#undef FLT_QUIET_NAN
#undef FLT_SIGNALING_NAN
#undef FLT_DENORM_MIN
#undef FLT_ROUND_ERR
#define FLT_HAS_INFINITY 1
#define FLT_HAS_QUIET_NAN 1
#define FLT_HAS_SIGNALING_NAN 1
@@ -54,10 +80,36 @@
#define FLT_EPSILON fennec::bit_cast<float>(0x34000000)
#define FLT_INF fennec::bit_cast<float>(0x7f800000)
#define FLT_QUIET_NAN fennec::bit_cast<float>(0x7fc00000)
#define FLT_SIGNALING_NAN fennec::bit_cast<float>(0x7fa00000)
#define FLT_SIGNALING_NAN fennec::bit_cast<float>(0x7fc00001)
#define FLT_DENORM_MIN fennec::bit_cast<float>(0x1)
#define FLT_ROUND_ERR fennec::bit_cast<float>(0x3f000000)
#undef DBL_HAS_INFINITY
#undef DBL_HAS_QUIET_NAN
#undef DBL_HAS_SIGNALING_NAN
#undef DBL_HAS_DENORM
#undef DBL_HAS_DENORM_LOSS
#undef DBL_ROUNDS
#undef DBL_IS_IEC559
#undef DBL_MANT_DIG
#undef DBL_DIG
#undef DBL_DECIMAL_DIG
#undef DBL_RADIX
#undef DBL_MIN_EXP
#undef DBL_MAX_EXP
#undef DBL_MIN_10_EXP
#undef DBL_MAX_10_EXP
#undef DBL_TRAPS
#undef DBL_TINYNESS_BEFORE
#undef DBL_MIN
#undef DBL_MAX
#undef DBL_EPSILON
#undef DBL_INF
#undef DBL_QUIET_NAN
#undef DBL_SIGNALING_NAN
#undef DBL_DENORM_MIN
#undef DBL_ROUND_ERR
#define DBL_HAS_INFINITY 1
#define DBL_HAS_QUIET_NAN 1
#define DBL_HAS_SIGNALING_NAN 1
@@ -80,7 +132,7 @@
#define DBL_EPSILON fennec::bit_cast<double>(0x3cb0000000000000ll)
#define DBL_INF fennec::bit_cast<double>(0x7ff0000000000000ll)
#define DBL_QUIET_NAN fennec::bit_cast<double>(0x7ff8000000000000ll)
#define DBL_SIGNALING_NAN fennec::bit_cast<double>(0x7ff4000000000000ll)
#define DBL_SIGNALING_NAN fennec::bit_cast<double>(0x7ff0000000000001ll)
#define DBL_DENORM_MIN fennec::bit_cast<double>(0x1ll)
#define DBL_ROUND_ERR fennec::bit_cast<double>(0x3fe0000000000000ll)

View File

@@ -57,27 +57,27 @@
#define CHAR_DIG 0x2
#define CHAR_DECIMAL_DIG 0x0
#define CHAR_RADIX 0x2
#define CHAR_TRAPS 0xtrue
#define CHAR_MIN 0xffffff80
#define CHAR_TRAPS 0xfalse
#define CHAR_MIN 0x80
#define CHAR_MAX 0x7f
#define WCHAR_IS_SIGNED true
#define WCHAR_IS_SIGNED false
#define WCHAR_ROUNDS 0x0
#define WCHAR_RADIX_DIG 0x1f
#define WCHAR_DIG 0x9
#define WCHAR_RADIX_DIG 0x10
#define WCHAR_DIG 0x4
#define WCHAR_DECIMAL_DIG 0x0
#define WCHAR_RADIX 0x2
#define WCHAR_TRAPS 0xtrue
#define WCHAR_MIN 0x80000000
#define WCHAR_MAX 0x7fffffff
#define WCHAR_TRAPS 0xfalse
#define WCHAR_MIN 0x0
#define WCHAR_MAX 0xffff
#define SCHAR_ROUNDS 0x0
#define SCHAR_RADIX_DIG 0x7
#define SCHAR_DIG 0x2
#define SCHAR_DECIMAL_DIG 0x0
#define SCHAR_RADIX 0x2
#define SCHAR_TRAPS 0xtrue
#define SCHAR_MIN 0xffffff80
#define SCHAR_TRAPS 0xfalse
#define SCHAR_MIN 0x80
#define SCHAR_MAX 0x7f
#define UCHAR_ROUNDS 0x0
@@ -85,7 +85,7 @@
#define UCHAR_DIG 0x2
#define UCHAR_DECIMAL_DIG 0x0
#define UCHAR_RADIX 0x2
#define UCHAR_TRAPS 0xtrue
#define UCHAR_TRAPS 0xfalse
#define UCHAR_MIN 0x0
#define UCHAR_MAX 0xff
@@ -94,7 +94,7 @@
#define SHORT_DIG 0x4
#define SHORT_DECIMAL_DIG 0x0
#define SHORT_RADIX 0x2
#define SHORT_TRAPS 0xtrue
#define SHORT_TRAPS 0xfalse
#define SHORT_MIN 0x8000
#define SHORT_MAX 0x7fff
@@ -103,7 +103,7 @@
#define USHORT_DIG 0x4
#define USHORT_DECIMAL_DIG 0x0
#define USHORT_RADIX 0x2
#define USHORT_TRAPS 0xtrue
#define USHORT_TRAPS 0xfalse
#define USHORT_MIN 0x0
#define USHORT_MAX 0xffff
@@ -112,7 +112,7 @@
#define INT_DIG 0x9
#define INT_DECIMAL_DIG 0x0
#define INT_RADIX 0x2
#define INT_TRAPS 0xtrue
#define INT_TRAPS 0xfalse
#define INT_MIN 0x80000000
#define INT_MAX 0x7fffffff
@@ -121,34 +121,34 @@
#define UINT_DIG 0x9
#define UINT_DECIMAL_DIG 0x0
#define UINT_RADIX 0x2
#define UINT_TRAPS 0xtrue
#define UINT_TRAPS 0xfalse
#define UINT_MIN 0x0
#define UINT_MAX 0xffffffff
#define LONG_ROUNDS 0x0
#define LONG_RADIX_DIG 0x3f
#define LONG_DIG 0x12
#define LONG_RADIX_DIG 0x1f
#define LONG_DIG 0x9
#define LONG_DECIMAL_DIG 0x0
#define LONG_RADIX 0x2
#define LONG_TRAPS 0xtrue
#define LONG_MIN 0x8000000000000000
#define LONG_MAX 0x7fffffffffffffff
#define LONG_TRAPS 0xfalse
#define LONG_MIN 0x80000000
#define LONG_MAX 0x7fffffff
#define ULONG_ROUNDS 0x0
#define ULONG_RADIX_DIG 0x40
#define ULONG_DIG 0x13
#define ULONG_RADIX_DIG 0x20
#define ULONG_DIG 0x9
#define ULONG_DECIMAL_DIG 0x0
#define ULONG_RADIX 0x2
#define ULONG_TRAPS 0xtrue
#define ULONG_TRAPS 0xfalse
#define ULONG_MIN 0x0
#define ULONG_MAX 0xffffffffffffffff
#define ULONG_MAX 0xffffffff
#define LLONG_ROUNDS 0x0
#define LLONG_RADIX_DIG 0x3f
#define LLONG_DIG 0x12
#define LLONG_DECIMAL_DIG 0x0
#define LLONG_RADIX 0x2
#define LLONG_TRAPS 0xtrue
#define LLONG_TRAPS 0xfalse
#define LLONG_MIN 0x8000000000000000
#define LLONG_MAX 0x7fffffffffffffff
@@ -157,7 +157,7 @@
#define ULLONG_DIG 0x13
#define ULLONG_DECIMAL_DIG 0x0
#define ULLONG_RADIX 0x2
#define ULLONG_TRAPS 0xtrue
#define ULLONG_TRAPS 0xfalse
#define ULLONG_MIN 0x0
#define ULLONG_MAX 0xffffffffffffffff

View File

@@ -99,18 +99,9 @@
///
// Most major compilers support __has_builtin, notably GCC, MINGW, CLANG, and MSVC
// Most major compilers support __has_builtin, notably GCC, MINGW, and CLANG
#if defined(__has_builtin)
// bitcast is slightly more efficient for build times than using memcpy
#if __has_builtin(__builtin_bit_cast)
# define FENNEC_HAS_BUILTIN_BIT_CAST 1
# define FENNEC_BUILTIN_BIT_CAST(type, arg) __builtin_bit_cast(type, arg)
#else
# define FENNEC_HAS_BUILTIN_BIT_CAST 0
#endif
// addressof is very difficult to implement without intrinsics.
#if __has_builtin(__builtin_addressof)
# define FENNEC_HAS_BUILTIN_ADDRESSOF 1
@@ -119,9 +110,31 @@
# define FENNEC_HAS_BUILTIN_ADDRESSOF 0
#endif
// bitcast is slightly more efficient for build times than using memcpy
#if __has_builtin(__builtin_bit_cast)
# define FENNEC_HAS_BUILTIN_BIT_CAST 1
# define FENNEC_BUILTIN_BIT_CAST(type, arg) __builtin_bit_cast(type, arg)
#else
# define FENNEC_HAS_BUILTIN_BIT_CAST 0
#endif
// Inconsistent without intrinsics
#if __has_builtin(__is_abstract)
# define FENNEC_HAS_BUILTIN_IS_ABSTRACT 1
# define FENNEC_BUILTIN_IS_ABSTRACT(arg) __is_abstract(arg)
#else
# define FENNEC_HAS_BUILTIN_IS_ABSTRACT 0
#endif
// Difficult and Inconsistent without intrinsics
#if __has_builtin(__is_constructible)
# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 1
# define FENNEC_BUILTIN_IS_CONSTRUCTIBLE(type, ...) __is_constructible(type, __VA_ARGS__)
#else
# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 0
#endif
// Type Traits
// can_convert is also very difficult to implement without intrinsics
#if __has_builtin(__is_convertible)
# define FENNEC_HAS_BUILTIN_IS_CONVERTIBLE 1
@@ -136,6 +149,14 @@
# define FENNEC_BUILTIN_IS_EMPTY(arg) __is_empty(arg)
#else
# define FENNEC_HAS_BUILTIN_IS_EMPTY 0
// Inconsistent without intrinsics
#if __has_builtin(__is_final)
# define FENNEC_HAS_BUILTIN_IS_FINAL 1
# define FENNEC_BUILTIN_IS_FINAL(arg) __is_final(arg)
#else
# define FENNEC_HAS_BUILTIN_IS_FINAL 0
#endif
#endif
// Inconsistent without intrinsics
@@ -146,22 +167,6 @@
# define FENNEC_HAS_BUILTIN_IS_POLYMORPHIC 0
#endif
// Inconsistent without intrinsics
#if __has_builtin(__is_final)
# define FENNEC_HAS_BUILTIN_IS_FINAL 1
# define FENNEC_BUILTIN_IS_FINAL(arg) __is_final(arg)
#else
# define FENNEC_HAS_BUILTIN_IS_FINAL 0
#endif
// Inconsistent without intrinsics
#if __has_builtin(__is_abstract)
# define FENNEC_HAS_BUILTIN_IS_ABSTRACT 1
# define FENNEC_BUILTIN_IS_ABSTRACT(arg) __is_abstract(arg)
#else
# define FENNEC_HAS_BUILTIN_IS_ABSTRACT 0
#endif
// Impossible without instrinsics
#if __has_builtin(__is_standard_layout)
# define FENNEC_HAS_BUILTIN_IS_STANDARD_LAYOUT 1
@@ -170,20 +175,40 @@
# define FENNEC_HAS_BUILTIN_IS_STANDARD_LAYOUT 0
#endif
// Difficult and Inconsistent without intrinsics
#if __has_builtin(__is_constructible)
# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 1
# define FENNEC_BUILTIN_IS_CONSTRUCTIBLE(type, ...) __is_constructible(type, __VA_ARGS__)
#else
# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 0
#endif
// For compilers without or differently named builtins
#else
// TODO: More compiler support
#if _MSC_VER
# define FENNEC_HAS_BUILTIN_ADDRESS_OF 1
# define FENNEC_BUILTIN_ADDRESS_OF(arg) __builtin_addressof(arg)
# define FENNEC_HAS_BUILTIN_BIT_CAST 1
# define FENNEC_BUILTIN_BIT_CAST(type, arg) __builtin_bit_cast(type, arg)
# define FENNEC_HAS_BUILTIN_IS_CONVERTIBLE 1
# define FENNEC_BUILTIN_IS_CONVERTIBLE(arg0, arg1) __is_convertible_to(arg0, arg1)
# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 1
# define FENNEC_BUILTIN_IS_CONSTRUCTIBLE(...) __is_constructible(__VA_ARGS__)
# define FENNEC_HAS_BUILTIN_IS_EMPTY 1
# define FENNEC_BUILTIN_IS_EMPTY(arg) __is_empty(arg)
# define FENNEC_HAS_BUILTIN_IS_FINAL 1
# define FENNEC_BUILTIN_IS_FINAL(arg) __is_final(arg)
# define FENNEC_HAS_BUILTIN_IS_POLYMORPHIC 1
# define FENNEC_BUILTIN_IS_POLYMORPHIC(arg) __is_polymorphic(arg)
# define FENNEC_HAS_BUILTIN_IS_STANDARD_LAYOUT 1
# define FENNEC_BUILTIN_IS_STANDARD_LAYOUT(arg) __is_standard_layout(arg)
#endif
#endif
#endif // FENNEC_LANG_INTRINSICS_H

View File

@@ -365,15 +365,15 @@ template<> struct numeric_limits<char>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return CHAR_MIN; }
static constexpr double max() { return CHAR_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr char min() { return static_cast<char>(CHAR_MIN); }
static constexpr char max() { return CHAR_MAX; }
static constexpr char lowest() { return 1; }
static constexpr char epsilon() { return 1; }
static constexpr char round_error() { return 0; }
static constexpr char infinity() { return 0; }
static constexpr char quiet_NaN() { return 0; }
static constexpr char signaling_NaN() { return 0; }
static constexpr char denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -403,15 +403,15 @@ template<> struct numeric_limits<signed char>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return SCHAR_MIN; }
static constexpr double max() { return SCHAR_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr signed char min() { return static_cast<signed char>(SCHAR_MIN); }
static constexpr signed char max() { return SCHAR_MAX; }
static constexpr signed char lowest() { return 1; }
static constexpr signed char epsilon() { return 1; }
static constexpr signed char round_error() { return 0; }
static constexpr signed char infinity() { return 0; }
static constexpr signed char quiet_NaN() { return 0; }
static constexpr signed char signaling_NaN() { return 0; }
static constexpr signed char denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -441,15 +441,15 @@ template<> struct numeric_limits<unsigned char>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return UCHAR_MIN; }
static constexpr double max() { return UCHAR_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr unsigned char min() { return UCHAR_MIN; }
static constexpr unsigned char max() { return UCHAR_MAX; }
static constexpr unsigned char lowest() { return 1; }
static constexpr unsigned char epsilon() { return 1; }
static constexpr unsigned char round_error() { return 0; }
static constexpr unsigned char infinity() { return 0; }
static constexpr unsigned char quiet_NaN() { return 0; }
static constexpr unsigned char signaling_NaN() { return 0; }
static constexpr unsigned char denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -479,15 +479,15 @@ template<> struct numeric_limits<short>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return SHORT_MIN; }
static constexpr double max() { return SHORT_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr short min() { return static_cast<short>(SHORT_MIN); }
static constexpr short max() { return SHORT_MAX; }
static constexpr short lowest() { return 1; }
static constexpr short epsilon() { return 1; }
static constexpr short round_error() { return 0; }
static constexpr short infinity() { return 0; }
static constexpr short quiet_NaN() { return 0; }
static constexpr short signaling_NaN() { return 0; }
static constexpr short denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -517,15 +517,15 @@ template<> struct numeric_limits<unsigned short>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return USHORT_MIN; }
static constexpr double max() { return USHORT_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr unsigned short min() { return USHORT_MIN; }
static constexpr unsigned short max() { return USHORT_MAX; }
static constexpr unsigned short lowest() { return 1; }
static constexpr unsigned short epsilon() { return 1; }
static constexpr unsigned short round_error() { return 0; }
static constexpr unsigned short infinity() { return 0; }
static constexpr unsigned short quiet_NaN() { return 0; }
static constexpr unsigned short signaling_NaN() { return 0; }
static constexpr unsigned short denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -555,15 +555,15 @@ template<> struct numeric_limits<int>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return INT_MIN; }
static constexpr double max() { return INT_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr int min() { return INT_MIN; }
static constexpr int max() { return INT_MAX; }
static constexpr int lowest() { return 1; }
static constexpr int epsilon() { return 1; }
static constexpr int round_error() { return 0; }
static constexpr int infinity() { return 0; }
static constexpr int quiet_NaN() { return 0; }
static constexpr int signaling_NaN() { return 0; }
static constexpr int denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -593,15 +593,15 @@ template<> struct numeric_limits<unsigned int>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return UINT_MIN; }
static constexpr double max() { return UINT_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr unsigned int min() { return UINT_MIN; }
static constexpr unsigned int max() { return UINT_MAX; }
static constexpr unsigned int lowest() { return 1; }
static constexpr unsigned int epsilon() { return 1; }
static constexpr unsigned int round_error() { return 0; }
static constexpr unsigned int infinity() { return 0; }
static constexpr unsigned int quiet_NaN() { return 0; }
static constexpr unsigned int signaling_NaN() { return 0; }
static constexpr unsigned int denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -631,15 +631,15 @@ template<> struct numeric_limits<long int>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return LONG_MIN; }
static constexpr double max() { return LONG_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr long int min() { return LONG_MIN; }
static constexpr long int max() { return LONG_MAX; }
static constexpr long int lowest() { return 1; }
static constexpr long int epsilon() { return 1; }
static constexpr long int round_error() { return 0; }
static constexpr long int infinity() { return 0; }
static constexpr long int quiet_NaN() { return 0; }
static constexpr long int signaling_NaN() { return 0; }
static constexpr long int denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -669,15 +669,15 @@ template<> struct numeric_limits<unsigned long int>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return ULONG_MIN; }
static constexpr double max() { return ULONG_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr unsigned long min() { return ULONG_MIN; }
static constexpr unsigned long max() { return ULONG_MAX; }
static constexpr unsigned long lowest() { return 1; }
static constexpr unsigned long epsilon() { return 1; }
static constexpr unsigned long round_error() { return 0; }
static constexpr unsigned long infinity() { return 0; }
static constexpr unsigned long quiet_NaN() { return 0; }
static constexpr unsigned long signaling_NaN() { return 0; }
static constexpr unsigned long denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -707,15 +707,15 @@ template<> struct numeric_limits<long long>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return LLONG_MIN; }
static constexpr double max() { return LLONG_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr long long min() { return LLONG_MIN; }
static constexpr long long max() { return LLONG_MAX; }
static constexpr long long lowest() { return 1; }
static constexpr long long epsilon() { return 1; }
static constexpr long long round_error() { return 0; }
static constexpr long long infinity() { return 0; }
static constexpr long long quiet_NaN() { return 0; }
static constexpr long long signaling_NaN() { return 0; }
static constexpr long long denorm_min() { return 0; }
};
// Overload for the builtin signed char type
@@ -745,15 +745,15 @@ template<> struct numeric_limits<unsigned long long>
static constexpr int max_exponent = 0;
static constexpr int max_exponent10 = 0;
static constexpr double min() { return ULLONG_MIN; }
static constexpr double max() { return ULLONG_MAX; }
static constexpr double lowest() { return 1; }
static constexpr double epsilon() { return 1; }
static constexpr double round_error() { return 0; }
static constexpr double infinity() { return 0; }
static constexpr double quiet_NaN() { return 0; }
static constexpr double signaling_NaN() { return 0; }
static constexpr double denorm_min() { return 0; }
static constexpr unsigned long long min() { return ULLONG_MIN; }
static constexpr unsigned long long max() { return ULLONG_MAX; }
static constexpr unsigned long long lowest() { return 1; }
static constexpr unsigned long long epsilon() { return 1; }
static constexpr unsigned long long round_error() { return 0; }
static constexpr unsigned long long infinity() { return 0; }
static constexpr unsigned long long quiet_NaN() { return 0; }
static constexpr unsigned long long signaling_NaN() { return 0; }
static constexpr unsigned long long denorm_min() { return 0; }
};
}

View File

@@ -153,15 +153,15 @@
/// \copybrief fennec::int64_t
///
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// <tt>\ref fennec::float32_t "float32_t"</tt>
/// <td width="50%" style="vertical-align: top">
/// \copybrief fennec::float32_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// <tt>\ref fennec::float64_t "float64_t"</tt>
/// <td width="50%" style="vertical-align: top">
/// \copybrief fennec::float64_t
///// <tr><td width="50%" style="vertical-align: top"> <br>
///// <tt>\ref fennec::float32_t "float32_t"</tt>
///// <td width="50%" style="vertical-align: top">
///// \copybrief fennec::float32_t
/////
///// <tr><td width="50%" style="vertical-align: top"> <br>
///// <tt>\ref fennec::float64_t "float64_t"</tt>
///// <td width="50%" style="vertical-align: top">
///// \copybrief fennec::float64_t
///
///
/// <tr><th colspan=2 style="text-align: center;">Special Types
@@ -253,10 +253,10 @@ namespace fennec
using nullptr_t = decltype(nullptr); ///< \brief Null Pointer Type
using intptr_t = intptr_t; ///< \brief Signed Integer Capable of Holding a Pointer to void
using uintptr_t = uintptr_t; ///< \brief Unsigned Integer Capable of Holding a Pointer to void
using intmax_t = __INTMAX_TYPE__; ///< \brief Maximum Width Signed Integer Type
using uintmax_t = __UINTMAX_TYPE__; ///< \brief Maximum Width Unsigned Integer Type
using size_t = __SIZE_TYPE__; ///< \brief Unsigned Integer Type Returned By `sizeof`, `sizeof...`, and `alignof`
using ptrdiff_t = __PTRDIFF_TYPE__; ///< \brief Signed Integer Type Returned by the Subtraction of two Pointers
using intmax_t = intmax_t; ///< \brief Maximum Width Signed Integer Type
using uintmax_t = uintmax_t; ///< \brief Maximum Width Unsigned Integer Type
using size_t = size_t; ///< \brief Unsigned Integer Type Returned By `sizeof`, `sizeof...`, and `alignof`
using ptrdiff_t = ptrdiff_t; ///< \brief Signed Integer Type Returned by the Subtraction of two Pointers
class undefined_t; ///< \brief undefined class for SFINAE
template<typename...> using void_t = void; ///< \brief Void type used for SFINAE
@@ -293,9 +293,9 @@ namespace fennec
/// \name Sized Floating-Point Types
/// @{
using float16_t = _Float16; ///< \brief A half-precision floating-point scalar
using float32_t = _Float32; ///< \brief A single-precision floating-point scalar
using float64_t = _Float64; ///< \brief A double-precision floating-point scalar
//using float16_t = _Float16; ///< \brief A half-precision floating-point scalar
//using float32_t = _Float32; ///< \brief A single-precision floating-point scalar
//using float64_t = _Float64; ///< \brief A double-precision floating-point scalar
/// @}