summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-01-01 11:27:41 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2014-01-01 11:27:41 -0800
commitb00cdd96e9b3fa641553c01ecbe03b6c3617b7df (patch)
tree9dfa1e87e6cc001cffe7557768400ccaf62e4e90
parentc10e9ece08ab58bf0d49fd1554879c379f810748 (diff)
downloademacs-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.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/lisp.h24
2 files changed, 20 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e41ccd168c6..1291815a4bc 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2014-01-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ * 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.
+
2014-01-01 Eli Zaretskii <eliz@gnu.org>
* search.c (newline_cache_on_off, find_newline): In indirect
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