diff options
author | Thomas Munro <tmunro@postgresql.org> | 2024-12-04 14:46:59 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2024-12-04 15:05:38 +1300 |
commit | 962da900ac8f0927f1af2fd811ca67fa163c873a (patch) | |
tree | 5839c22d2ad7bc68ddfd1e4debc734ef5df3a9d1 /src/interfaces/ecpg/test | |
parent | 3b08d5224d7df71cc111d8522cf6190fc02f6fb9 (diff) | |
download | postgresql-962da900ac8f0927f1af2fd811ca67fa163c873a.tar.gz postgresql-962da900ac8f0927f1af2fd811ca67fa163c873a.zip |
Use <stdint.h> and <inttypes.h> for c.h integers.
Redefine our exact width types with standard C99 types and macros,
including int64_t, INT64_MAX, INT64_C(), PRId64 etc. We were already
using <stdint.h> types in a few places.
One complication is that Windows' <inttypes.h> uses format strings like
"%I64d", "%I32", "%I" for PRI*64, PRI*32, PTR*PTR, instead of mapping to
other standardized format strings like "%lld" etc as seen on other known
systems. Teach our snprintf.c to understand them.
This removes a lot of configure clutter, and should also allow 64-bit
numbers and other standard types to be used in localized messages
without casting.
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/ME3P282MB3166F9D1F71F787929C0C7E7B6312%40ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM
Diffstat (limited to 'src/interfaces/ecpg/test')
-rw-r--r-- | src/interfaces/ecpg/test/expected/compat_informix-sqlda.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c b/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c index 7e19319d27f..8eebc51664e 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c @@ -97,12 +97,14 @@ typedef struct sqlda_struct sqlda_t; #define SQLINTERVAL ECPGt_interval #define SQLNCHAR ECPGt_char #define SQLNVCHAR ECPGt_char -#ifdef HAVE_LONG_LONG_INT_64 +#if SIZEOF_LONG == 8 +#define SQLINT8 ECPGt_long +#define SQLSERIAL8 ECPGt_long +#elif SIZEOF_LONG_LONG == 8 #define SQLINT8 ECPGt_long_long #define SQLSERIAL8 ECPGt_long_long #else -#define SQLINT8 ECPGt_long -#define SQLSERIAL8 ECPGt_long +#error "cannot find integer type of the same size as SQLINT8" #endif #endif /* ndef ECPG_SQLTYPES_H */ |