#endif
#include "handy.h"
+#include "charclass_invlists.h"
#if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_RAWIO)
# if LSEEKSIZE == 8 && !defined(USE_64_BIT_RAWIO)
/* placeholder */
#endif
-#if defined(static_assert) || (defined(__cplusplus) && __cplusplus >= 201103L)
+/* STATIC_ASSERT_GLOBAL/STATIC_ASSERT_STMT are like assert(), but for compile
+ time invariants. That is, their argument must be a constant expression that
+ can be verified by the compiler. This expression can contain anything that's
+ known to the compiler, e.g. #define constants, enums, or sizeof (...). If
+ the expression evaluates to 0, compilation fails.
+ Because they generate no runtime code (i.e. their use is "free"), they're
+ always active, even under non-DEBUGGING builds.
+ STATIC_ASSERT_GLOBAL expands to a declaration and is suitable for use at
+ file scope (outside of any function).
+ STATIC_ASSERT_STMT expands to a statement and is suitable for use inside a
+ function.
+*/
+#if (defined(static_assert) || (defined(__cplusplus) && __cplusplus >= 201103L)) && (!defined(__IBMC__) || __IBMC__ >= 1210)
/* static_assert is a macro defined in <assert.h> in C11 or a compiler
builtin in C++11.
*/
+/* IBM XL C V11 does not support _Static_assert, no matter what <assert.h> says */
# define STATIC_ASSERT_GLOBAL(COND) static_assert(COND, #COND)
#else
/* We use a bit-field instead of an array because gcc accepts
END_EXTERN_C
#endif
-#ifdef WIN32
-# if !defined(NV_INF) && defined(HUGE_VAL)
-# define NV_INF HUGE_VAL
-# endif
-/* For WIN32 the best NV_NAN is the __PL_nan_u trick, see below.
- * There is no supported way of getting the NAN across all the crts. */
-#endif
-
/* If you are thinking of using HUGE_VAL for infinity, or using
* <math.h> functions to generate NV_INF (e.g. exp(1e9), log(-1.0)),
* stop. Neither will work portably: HUGE_VAL can be just DBL_MAX,
# endif
# if !defined(NV_NAN) && defined(LDBL_QNAN)
# define NV_NAN LDBL_QNAN
+# define NV_QNAN LDBL_QNAN
# endif
# if !defined(NV_NAN) && defined(LDBL_SNAN)
# define NV_NAN LDBL_SNAN
+# define NV_SNAN LDBL_SNAN
# endif
#endif
#if !defined(NV_NAN) && defined(DBL_NAN)
#endif
#if !defined(NV_NAN) && defined(DBL_QNAN)
# define NV_NAN (NV)DBL_QNAN
+# define NV_QNAN DBL_QNAN
#endif
#if !defined(NV_NAN) && defined(DBL_SNAN)
# define NV_NAN (NV)DBL_SNAN
+# define NV_SNAN DBL_SNAN
#endif
#if !defined(NV_NAN) && defined(NAN)
# define NV_NAN (NV)NAN
#endif
#if !defined(NV_NAN) && defined(QNAN)
# define NV_NAN (NV)QNAN
+# define NV_QNAN QNAN
#endif
#if !defined(NV_NAN) && defined(SNAN)
# define NV_NAN (NV)SNAN
+# define NV_SNAN SNAN
#endif
#if !defined(NV_NAN) && defined(I_SUNMATH)
# define NV_NAN (NV)quiet_nan()
int). value returned in pointed-
to UV */
#define IS_NUMBER_GREATER_THAN_UV_MAX 0x02 /* pointed to UV undefined */
-#define IS_NUMBER_NOT_INT 0x04 /* saw . or E notation */
+#define IS_NUMBER_NOT_INT 0x04 /* saw . or E notation or infnan */
#define IS_NUMBER_NEG 0x08 /* leading minus sign */
#define IS_NUMBER_INFINITY 0x10 /* this is big */
#define IS_NUMBER_NAN 0x20 /* this is not */
#ifdef NV_IMPLICIT_BIT
# define NV_MANT_REAL_DIG (NV_MANT_DIG - 1)
#else
-# define NV_MANT_REAL_DIG
+# define NV_MANT_REAL_DIG (NV_MANT_DIG)
#endif
/*