use clib locale code whenever compiler is gcc; try to use stdint.h types in cryptlib when possible

This commit is contained in:
Brian Cox 2019-09-21 16:03:51 -07:00
parent 0467ede8d9
commit 458d8652b3
2 changed files with 17 additions and 4 deletions

View File

@ -353,8 +353,7 @@
// Used in twlocale
# define USE_STD_CPP_LOCALE_WORKAROUND \
(IS_SUNPRO || (IS_KAI && !IS_KAI_3_4)) // TODO:BAM -- name this something more general.
//# define USE_CLIB_LOCALE IS_KAI || HAVE_GCC
# define USE_CLIB_LOCALE (!HAVE_LOCALE || (HAVE_GCC && (IS_SOLARIS || IS_AIX)))
# define USE_CLIB_LOCALE (!HAVE_LOCALE || HAVE_GCC || IS_KAI)
# define USES_CLIB_DATE_FUNCTION \
(USE_CLIB_LOCALE || IS_SUNPRO || \
IS_MSVC) // if we use clib, can't use C++ time_put, and SUNPRO and MSVC add characters

View File

@ -88,6 +88,7 @@ typedef unsigned char uint8_t;
#include <stdint.h>
#endif
#if __cplusplus < 201103L
typedef unsigned short word16;
#if SIZEOF_INT == 4
typedef unsigned int word32;
@ -96,6 +97,10 @@ typedef unsigned short word16;
#else
#error "I don't seem to have a 32-bit integer type on this system."
#endif
#else
typedef uint16_t word16;
typedef uint32_t word32;
#endif
// word should have the same size as your CPU registers
// dword should be twice as big as word
@ -146,16 +151,25 @@ typedef unsigned long long word64;
#elif defined(__GNUC__)
#if __cplusplus < 201103L
typedef word32 word;
#if SIZEOF_LONG_LONG == 8
typedef unsigned long long dword;
#define WORD64_AVAILABLE
typedef unsigned long long word64;
#define W64LIT(x) x##LL
#else
#else
#error "I don't seem to have a 64-bit integer type on this system."
#endif
#else
#else // __cplusplus < 201103L
typedef uint32_t word;
typedef uint64_t dword;
typedef uint64_t word64;
#endif
#else // compiler type
typedef unsigned int word;
typedef unsigned long dword;