diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2014-01-01 11:27:41 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-01-01 11:27:41 -0800 |
commit | b00cdd96e9b3fa641553c01ecbe03b6c3617b7df (patch) | |
tree | 9dfa1e87e6cc001cffe7557768400ccaf62e4e90 /src/lisp.h | |
parent | c10e9ece08ab58bf0d49fd1554879c379f810748 (diff) | |
download | emacs-b00cdd96e9b3fa641553c01ecbe03b6c3617b7df.tar.gz |
* lisp.h (EMACS_INT): Configure based on INTPTR_MAX, not LONG_MAX.
This is a cleaner way to fix the MinGW-w64 porting problem.
Check for INTPTR_MAX misconfiguration.
Diffstat (limited to 'src/lisp.h')
-rw-r--r-- | src/lisp.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/lisp.h b/src/lisp.h index 2a6d996a1ab..043e5b13f6b 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -63,21 +63,25 @@ INLINE_HEADER_BEGIN pI - printf length modifier for EMACS_INT EMACS_UINT - unsigned variant of EMACS_INT */ #ifndef EMACS_INT_MAX -# if LONG_MAX < LLONG_MAX && (defined(WIDE_EMACS_INT) || defined(_WIN64)) -typedef long long int EMACS_INT; -typedef unsigned long long int EMACS_UINT; -# define EMACS_INT_MAX LLONG_MAX -# define pI "ll" -# elif INT_MAX < LONG_MAX +# if INTPTR_MAX <= 0 +# error "INTPTR_MAX misconfigured" +# elif INTPTR_MAX <= INT_MAX && !defined WIDE_EMACS_INT +typedef int EMACS_INT; +typedef unsigned int EMACS_UINT; +# define EMACS_INT_MAX INT_MAX +# define pI "" +# elif INTPTR_MAX <= LONG_MAX && !defined WIDE_EMACS_INT typedef long int EMACS_INT; typedef unsigned long EMACS_UINT; # define EMACS_INT_MAX LONG_MAX # define pI "l" +# elif INTPTR_MAX <= LLONG_MAX +typedef long long int EMACS_INT; +typedef unsigned long long int EMACS_UINT; +# define EMACS_INT_MAX LLONG_MAX +# define pI "ll" # else -typedef int EMACS_INT; -typedef unsigned int EMACS_UINT; -# define EMACS_INT_MAX INT_MAX -# define pI "" +# error "INTPTR_MAX too large" # endif #endif |