2011-02-21 20:16:43 +00:00
|
|
|
/* Replacement stdint.h file for building GNU Emacs on Windows.
|
|
|
|
|
2013-01-01 09:11:05 +00:00
|
|
|
Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
2011-02-21 20:16:43 +00:00
|
|
|
|
|
|
|
This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
#ifndef _NT_STDINT_H_
|
|
|
|
#define _NT_STDINT_H_
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
# include_next <stdint.h> /* use stdint.h if available */
|
|
|
|
#else /* !__GNUC__ */
|
|
|
|
|
|
|
|
/* Minimum definitions to allow compilation with tool chains where
|
|
|
|
stdint.h is not available, e.g. Microsoft Visual Studio. */
|
|
|
|
|
* inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX)
(UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX)
(INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN)
(intmax_t, INT64_MAX): Add for MSVC.
2011-11-05 22:33:44 +00:00
|
|
|
#ifdef _WIN64
|
|
|
|
typedef __int64 intptr_t;
|
2011-11-27 18:52:53 +00:00
|
|
|
typedef unsigned int uint32_t;
|
|
|
|
typedef unsigned __int64 uint64_t;
|
|
|
|
#define UINT64_MAX (18446744073709551615i64)
|
* inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX)
(UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX)
(INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN)
(intmax_t, INT64_MAX): Add for MSVC.
2011-11-05 22:33:44 +00:00
|
|
|
#define UINT64_MIN 0
|
2011-06-07 12:34:09 +00:00
|
|
|
/* "i64" is the non-standard suffix used by MSVC for 64-bit constants. */
|
|
|
|
#define INT64_MAX 9223372036854775807i64
|
* inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX)
(UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX)
(INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN)
(intmax_t, INT64_MAX): Add for MSVC.
2011-11-05 22:33:44 +00:00
|
|
|
#define INT64_MIN (~INT64_MAX)
|
2011-06-07 12:34:09 +00:00
|
|
|
#define INTPTR_MAX INT64_MAX
|
2012-11-20 17:07:55 +00:00
|
|
|
#define INTPTR_MIN INT64_MIN
|
* inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX)
(UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX)
(INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN)
(intmax_t, INT64_MAX): Add for MSVC.
2011-11-05 22:33:44 +00:00
|
|
|
#define UINTMAX_MAX UINT64_MAX
|
|
|
|
#define UINTMAX_MIN UINT64_MIN
|
|
|
|
#define INTMAX_MAX INT64_MAX
|
|
|
|
#define INTMAX_MIN INT64_MIN
|
2011-11-27 18:52:53 +00:00
|
|
|
#define uintmax_t unsigned __int64
|
|
|
|
#define intmax_t __int64
|
2011-05-06 12:09:08 +00:00
|
|
|
#else
|
* inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX)
(UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX)
(INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN)
(intmax_t, INT64_MAX): Add for MSVC.
2011-11-05 22:33:44 +00:00
|
|
|
typedef int intptr_t;
|
|
|
|
typedef unsigned int uint32_t;
|
2011-11-13 14:43:13 +00:00
|
|
|
#define UINT32_MAX 4294967295
|
* inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX)
(UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX)
(INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN)
(intmax_t, INT64_MAX): Add for MSVC.
2011-11-05 22:33:44 +00:00
|
|
|
#define UINT32_MIN 0
|
|
|
|
#define INT32_MAX 2147483647
|
|
|
|
#define INT32_MIN (~INT32_MAX)
|
2011-06-07 12:34:09 +00:00
|
|
|
#define INTPTR_MAX INT32_MAX
|
2012-11-20 17:07:55 +00:00
|
|
|
#define INTPTR_MIN INT32_MIN
|
* inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX)
(UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX)
(INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN)
(intmax_t, INT64_MAX): Add for MSVC.
2011-11-05 22:33:44 +00:00
|
|
|
#define UINTMAX_MAX UINT32_MAX
|
|
|
|
#define UINTMAX_MIN UINT32_MIN
|
|
|
|
#define INTMAX_MAX INT32_MAX
|
|
|
|
#define INTMAX_MIN INT32_MIN
|
2011-11-27 18:52:53 +00:00
|
|
|
#define uintmax_t unsigned long
|
|
|
|
#define intmax_t long
|
2011-05-06 12:09:08 +00:00
|
|
|
#endif
|
|
|
|
|
2011-06-07 12:34:09 +00:00
|
|
|
#define PTRDIFF_MAX INTPTR_MAX
|
2012-11-19 17:34:21 +00:00
|
|
|
#define PTRDIFF_MIN INTPTR_MIN
|
2011-05-06 12:09:08 +00:00
|
|
|
|
2011-02-21 20:16:43 +00:00
|
|
|
#endif /* !__GNUC__ */
|
|
|
|
|
|
|
|
#endif /* _NT_STDINT_H_ */
|