nasmint.h: add support for the MSVS < 2005 __int64 type

MSVS < 2005 doesn't have "long long", so use the MSVC-specific
__int64, I64, and ...[u]i64 constructs.  nasmint.h makes this easy
enough that it is worth doing.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2016-10-04 17:59:20 -07:00
parent 2024ae60d6
commit 4b189f89d0

View File

@ -14,7 +14,7 @@
#include <limits.h>
/*** 64-bit type: long or long long ***/
/*** 64-bit type: __int64, long or long long ***/
/* Some old versions of gcc <limits.h> omit LLONG_MAX */
#ifndef LLONG_MAX
@ -25,7 +25,25 @@
# endif
#endif
#if LONG_MAX == 9223372036854775807L
#ifndef _I64_MAX
# ifdef _MSC_VER
# define _I64_MAX 9223372036854775807
# else
# define _I64_MAX 0
# endif
#endif
#if _I64_MAX == 9223372036854775807
/* Windows-based compiler: use __int64 */
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#define _scn64 "I64"
#define _pri64 "I64"
#define INT64_C(x) x ## i64
#define UINT64_C(x) x ## ui64
#elif LONG_MAX == 9223372036854775807L
/* long is 64 bits */
typedef signed long int64_t;