Mercurial > hg > th-libs
changeset 573:7c0aa6bf484a
Improve system bit-ness handling and target platform.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 09 Jan 2020 16:53:16 +0200 |
parents | 6d2d3b512750 |
children | 872d2a65ce56 |
files | th_types.h th_util.h |
diffstat | 2 files changed, 20 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/th_types.h Thu Jan 09 13:48:58 2020 +0200 +++ b/th_types.h Thu Jan 09 16:53:16 2020 +0200 @@ -11,6 +11,18 @@ #ifndef TH_TYPES_H #define TH_TYPES_H 1 + +// Check for system type +#if defined(__WIN64) || defined(_WIN64) || defined(__WIN32) || defined(_WIN32) +# define TH_PLAT_WINDOWS 1 +#elif defined(__DJGPP__) && __DJGPP__ >= 2 +# define TH_PLAT_DOS 1 +# undef __STRICT_ANSI__ +#else +# define TH_PLAT_UNIX 1 +#endif + + // Check for standard headers #if defined(HAVE_STDINT_H) # include <stdint.h> @@ -30,6 +42,14 @@ // Check for arch bitness +#if !defined(TH_ARCH) && (defined(__WIN64) || defined(_WIN64)) +# define TH_ARCH 64 +#endif + +#if !defined(TH_ARCH) && (defined(__WIN32) || defined(_WIN32)) +# define TH_ARCH 32 +#endif + #if !defined(TH_ARCH) # if UINTPTR_MAX == 0xffffffff # define TH_ARCH 32 @@ -47,15 +67,6 @@ # endif #endif -#if !defined(TH_ARCH) && (defined(__WIN64) || defined(_WIN64)) -# define TH_ARCH 64 -#endif - -#if !defined(TH_ARCH) && (defined(__WIN32) || defined(_WIN32)) -# define TH_ARCH 32 -#endif - - // Do we have a valid arch? // If so, set some printf specifiers and other useful things #if TH_ARCH == 32
--- a/th_util.h Thu Jan 09 13:48:58 2020 +0200 +++ b/th_util.h Thu Jan 09 16:53:16 2020 +0200 @@ -12,15 +12,6 @@ #include "config.h" #endif -#if defined(__WIN64) || defined(_WIN64) || defined(__WIN32) || defined(_WIN32) -# define TH_PLAT_WINDOWS 1 -#elif defined(__DJGPP__) && __DJGPP__ >= 2 -# define TH_PLAT_DOS 1 -# undef __STRICT_ANSI__ -#else -# define TH_PLAT_UNIX 1 -#endif - #include "th_types.h" #include <stdio.h> #include <stdarg.h>