Skip to content
Snippets Groups Projects
Commit 886b536a authored by Sean McBride's avatar Sean McBride
Browse files

Merge branch 'upstream-KWIML' into kwiml-2022-06-30

# By KWIML Upstream
* upstream-KWIML:
  KWIML 2022-06-14 (7b9bd7fe)
parents 2db90a3f e6fb3a17
No related branches found
No related tags found
No related merge requests found
......@@ -136,6 +136,8 @@ suppression macro KWIML_ABI_NO_VERIFY was defined.
# define KWIML_ABI_SIZEOF_DATA_PTR 8
# elif defined(__i386) || defined(__i386__)
# define KWIML_ABI_SIZEOF_DATA_PTR 4
# elif defined(_M_ARM64)
# define KWIML_ABI_SIZEOF_DATA_PTR 8
# endif
#endif
#if !defined(KWIML_ABI_SIZEOF_DATA_PTR)
......@@ -407,6 +409,10 @@ suppression macro KWIML_ABI_NO_VERIFY was defined.
#elif defined(__hppa) || defined(__hppa__)
# define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_BIG
/* LoongArch64 */
#elif defined(__loongarch64)
# define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_LITTLE
/* Motorola 68k */
#elif defined(__m68k__) || defined(M68000)
# define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_BIG
......@@ -461,6 +467,10 @@ suppression macro KWIML_ABI_NO_VERIFY was defined.
# define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_BIG
# endif
/* Aarch64 (Windows) */
#elif defined(_M_ARM64)
# define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_LITTLE
/* Xtensa */
#elif defined(__XTENSA_EB__)
# define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_BIG
......
......@@ -162,7 +162,11 @@ An includer may test the following macros after inclusion:
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
# define KWIML_INT_HAVE_INTTYPES_H 1
#elif defined(_MSC_VER) /* MSVC */
# define KWIML_INT_NO_INTTYPES_H 1
# if _MSC_VER >= 1800
# define KWIML_INT_HAVE_INTTYPES_H 1
# else
# define KWIML_INT_NO_INTTYPES_H 1
# endif
#elif defined(__BORLANDC__) /* Borland */
# define KWIML_INT_NO_INTTYPES_H 1
#elif defined(__WATCOMC__) /* Watcom */
......@@ -272,6 +276,15 @@ An includer may test the following macros after inclusion:
# define KWIML_INT_BROKEN_PRIXPTR 1
#endif
#if defined(_MSC_VER) && _MSC_VER < 1900
/* MSVC scanf seems broken on 8-bit sizes until 19.00 */
# define KWIML_INT_BROKEN_SCNd8 1
# define KWIML_INT_BROKEN_SCNi8 1
# define KWIML_INT_BROKEN_SCNo8 1
# define KWIML_INT_BROKEN_SCNu8 1
# define KWIML_INT_BROKEN_SCNx8 1
#endif
#if (defined(__SUNPRO_C)||defined(__SUNPRO_CC)) && defined(_CHAR_IS_UNSIGNED)
# define KWIML_INT_BROKEN_INT8_T 1 /* system type defined incorrectly */
#elif defined(__BORLANDC__) && defined(_CHAR_UNSIGNED)
......@@ -303,7 +316,7 @@ An includer may test the following macros after inclusion:
#elif defined(__BORLANDC__)
# define KWIML_INT_private_NO_SCN8
# define KWIML_INT_private_NO_SCN64
#elif defined(_MSC_VER)
#elif defined(_MSC_VER) && _MSC_VER < 1900
# define KWIML_INT_private_NO_SCN8
#elif defined(__WATCOMC__)
# define KWIML_INT_private_NO_SCN8
......@@ -706,7 +719,7 @@ An includer may test the following macros after inclusion:
#endif
#if defined(__INTEL_COMPILER)
#elif defined(__BORLANDC__)
#elif defined(__BORLANDC__) && !defined(__CODEGEARC_VERSION__)
# define KWIML_INT_private_NO_FMTLL /* type 'long long' but not 'll' format */
# define KWIML_INT_BROKEN_INT64_C 1 /* system macro defined incorrectly */
# define KWIML_INT_BROKEN_UINT64_C 1 /* system macro defined incorrectly */
......
......@@ -24,6 +24,12 @@
# define STATIC_CAST(t,v) (t)(v)
#endif
#if defined(_MSC_VER) && _MSC_VER < 1900
# define SNPRINTF(buf, sz, fmt, x) sprintf(buf, fmt, x)
#else
# define SNPRINTF(buf, sz, fmt, x) snprintf(buf, sz, fmt, x)
#endif
#define VALUE(T, U) STATIC_CAST(T, STATIC_CAST(U, 0xab) << ((sizeof(T)-1)<<3))
#define TEST_C_(C, V, PRI, T, U) \
......@@ -48,7 +54,7 @@
{ \
T const x = VALUE(T, U); \
char const* str = STR; \
sprintf(buf, "%" KWIML_INT_PRI##PRI, x); \
SNPRINTF(buf, sizeof(buf), "%" KWIML_INT_PRI##PRI, x); \
printf(LANG "KWIML_INT_PRI" #PRI ":" \
" expected [%s], got [%s]", str, buf); \
if(strcmp(str, buf) == 0) \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment