[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
support 64-bit EMACS_INT on 32-bit hosts
From: |
Paul Eggert |
Subject: |
support 64-bit EMACS_INT on 32-bit hosts |
Date: |
Fri, 29 Apr 2011 01:56:40 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 |
On 04/29/11 01:08, Paul Eggert wrote:
> Step 2 will change EMACS_INT to be 64 bits on 32+64-bit ports.
> That is a bigger deal, and I'll send a later email about it.
Here's a simple patch to do this. With this patch (atop the previous one),
I've successfully used Emacs to edit a 2 GB file on an x86 (32-bit)
platform. I've only done very limited testing with this patch,
though, and I don't plan to install this patch right now; it needs
more testing. However, I thought I'd publish it now as a heads-up.
* lisp.h: Prefer 64-bit EMACS_INT if available.
(EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
on 32-bit hosts that have 64-bit int, so that they can access
large files.
=== modified file 'src/lisp.h'
--- src/lisp.h 2011-04-29 07:54:43 +0000
+++ src/lisp.h 2011-04-29 08:48:05 +0000
@@ -44,7 +44,16 @@
#ifndef EMACS_UINT
#define EMACS_UINT unsigned long
#endif
-#else /* not _LP64 */
+#elif /* !_LP64 && */ BITS_PER_LONG < BITS_PER_LONG_LONG
+#ifndef EMACS_INT
+#define EMACS_INT long long
+#define BITS_PER_EMACS_INT BITS_PER_LONG_LONG
+#define pI "ll"
+#endif
+#ifndef EMACS_UINT
+#define EMACS_UINT unsigned long long
+#endif
+#else /* ! (_LP64 || BITS_PER_LONG < BITS_PER_LONG_LONG) */
#ifndef EMACS_INT
#define EMACS_INT int
#define BITS_PER_EMACS_INT BITS_PER_INT
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, (continued)
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, Eli Zaretskii, 2011/04/29
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, Stefan Monnier, 2011/04/29
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, Eli Zaretskii, 2011/04/29
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, Lars Magne Ingebrigtsen, 2011/04/29
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, Paul Eggert, 2011/04/29
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, David De La Harpe Golden, 2011/04/29
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, Stephen J. Turnbull, 2011/04/30
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, Paul Eggert, 2011/04/29
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, Paul Eggert, 2011/04/30
- Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts, Eli Zaretskii, 2011/04/30
support 64-bit EMACS_INT on 32-bit hosts,
Paul Eggert <=