Windows visual studio vs gcc long and ulong

The visual studio compiler behaves diffently with _Generic than with
gcc on Linux _Generic around long and ulong.

On Windows they aren't recognized as one of the stdint types.

On Linux gcc, it considers them equivalent to int64_t and uint64_t.

Leave it out of the _Generic to avoid the behaviour difference between
platforms/compilers.
This commit is contained in:
nhmall
2025-05-26 11:50:23 -04:00
parent aa5c325bd4
commit 86a7bfa7e9
2 changed files with 8 additions and 18 deletions

View File

@@ -249,8 +249,6 @@ extern void sfi_ulong(NHFILE *, ulong *, const char *);
#define Sfo_ushort(a, b, c) sfo_ushort(a, b, c)
#define Sfo_int(a, b, c) sfo_int(a, b, c)
#define Sfo_unsigned(a, b, c) sfo_unsigned(a, b, c)
#define Sfo_long(a,b,c) sfo_long(a, b, c);
#define Sfo_ulong(a,b,c) sfo_ulong(a, b, c);
#define Sfo_boolean(a,b,c) sfo_boolean(a, b, c);
#define Sfo_xint8(a, b, c) sfo_xint8(a, b, c);
#define Sfo_xint16(a, b, c) sfo_xint16(a, b, c)
@@ -319,8 +317,6 @@ extern void sfi_ulong(NHFILE *, ulong *, const char *);
#define Sfi_ushort(a, b, c) sfi_ushort(a, b, c)
#define Sfi_int(a, b, c) sfi_int(a, b, c);
#define Sfi_unsigned(a, b, c) sfi_unsigned(a, b, c);
#define Sfi_long(a,b,c) sfi_long(a, b, c);
#define Sfi_ulong(a,b,c) sfi_ulong(a, b, c);
#define Sfi_boolean(a,b,c) sfi_boolean(a, b, c);
#define Sfi_xint8(a, b, c) sfi_xint8(a, b, c);
#define Sfi_xint16(a, b, c) sfi_xint16(a, b, c);
@@ -336,8 +332,6 @@ extern void sfi_ulong(NHFILE *, ulong *, const char *);
uint16_t * : sfo_uint16, \
uint32_t * : sfo_uint32, \
uint64_t * : sfo_uint64, \
long * : sfo_long, \
unsigned long * : sfo_ulong, \
xint8 * : sfo_xint8, \
struct arti_info * : sfo_arti_info, \
struct nhrect * : sfo_nhrect, \
@@ -400,8 +394,6 @@ extern void sfi_ulong(NHFILE *, ulong *, const char *);
uint16_t * : sfi_uint16, \
uint32_t * : sfi_uint32, \
uint64_t * : sfi_uint64, \
long * : sfi_long, \
unsigned long * : sfi_ulong, \
xint8 * : sfi_xint8, \
struct arti_info * : sfi_arti_info, \
struct nhrect * : sfi_nhrect, \
@@ -520,11 +512,12 @@ extern void sfi_ulong(NHFILE *, ulong *, const char *);
#define Sfo_ushort(a, b, c) sfo(a, b, c)
#define Sfo_int(a, b, c) sfo(a, b, c)
#define Sfo_unsigned(a, b, c) sfo(a, b, c)
#define Sfo_long(a,b,c) sfo(a, b, c)
#define Sfo_ulong(a,b,c) sfo(a, b, c)
#define Sfo_xint8(a, b, c) sfo(a, b, c)
#define Sfo_xint16(a, b, c) sfo(a, b, c)
/* not in _Generic */
#define Sfo_long(a,b,c) sfo_long(a, b, c);
#define Sfo_ulong(a,b,c) sfo_ulong(a, b, c);
#define Sfo_char(a,b,c,d) sfo_char(a, b, c, d)
#define Sfo_boolean(a,b,c) sfo_boolean(a, b, c)
#define Sfo_schar(a,b,c) sfo_schar(a, b, c)
@@ -591,11 +584,12 @@ extern void sfi_ulong(NHFILE *, ulong *, const char *);
#define Sfi_ushort(a, b, c) sfi(a, b, c)
#define Sfi_int(a,b,c) sfi(a, b, c)
#define Sfi_unsigned(a, b, c) sfi(a, b, c)
#define Sfi_long(a,b,c) sfi(a, b, c)
#define Sfi_ulong(a,b,c) sfi(a, b, c)
#define Sfi_xint8(a, b, c) sfi(a, b, c)
#define Sfi_xint16(a, b, c) sfi(a, b, c)
/* not in _Generic */
#define Sfi_long(a,b,c) sfi_long(a, b, c);
#define Sfi_ulong(a,b,c) sfi_ulong(a, b, c);
#define Sfi_char(a,b,c,d) sfi_char(a, b, c, d)
#define Sfi_boolean(a,b,c) sfi_boolean(a, b, c)
#define Sfi_schar(a,b,c) sfi_schar(a, b, c)

View File

@@ -65,8 +65,6 @@ void sf_log(NHFILE *, const char *, size_t, int, char *);
#define Sfvalue_ushort(a) sfvalue_ushort(a)
#define Sfvalue_int(a) sfvalue_int(a)
#define Sfvalue_unsigned(a) sfvalue_unsigned(a)
#define Sfvalue_long(a) sfvalue_long(a)
#define Sfvalue_ulong(a) sfvalue_ulong(a)
#define Sfvalue_xint8(a) sfvalue_xint8(a)
#define Sfvalue_xint16(a) sfvalue_xint16(a)
@@ -83,8 +81,6 @@ void sf_log(NHFILE *, const char *, size_t, int, char *);
uint16_t *: sfvalue_uint16, \
uint32_t *: sfvalue_uint32, \
uint64_t *: sfvalue_uint64, \
long *: sfvalue_long, \
unsigned long *: sfvalue_ulong, \
xint8 *: sfvalue_xint8 \
)(x)
@@ -107,13 +103,13 @@ void sf_log(NHFILE *, const char *, size_t, int, char *);
#define Sfvalue_ushort(a) sfvalue(a)
#define Sfvalue_int(a) sfvalue(a)
#define Sfvalue_unsigned(a) sfvalue(a)
#define Sfvalue_long(a) sfvalue(a)
#define Sfvalue_ulong(a) sfvalue(a)
#define Sfvalue_xint8(a) sfvalue(a)
#define Sfvalue_xint16(a) sfvalue(a)
#endif
/* not in _Generic */
#define Sfvalue_long(a) sfvalue_long(a)
#define Sfvalue_ulong(a) sfvalue_ulong(a)
#define Sfvalue_char(a, d) sfvalue_char(a, d)
#define Sfvalue_boolean(a) sfvalue_boolean(a)
#define Sfvalue_schar(a) sfvalue_schar(a)