From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: bookkeeping to prepare for a 64-bit EMACS_INT on 32-bit hosts Date: Fri, 29 Apr 2011 23:54:50 -0700 Organization: UCLA Computer Science Department Message-ID: <4DBBB23A.6050702@cs.ucla.edu> References: <4DBA71FB.5090900@cs.ucla.edu> <83mxj97889.fsf@gnu.org> <4DBA7F87.5040609@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1304146504 2488 80.91.229.12 (30 Apr 2011 06:55:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 30 Apr 2011 06:55:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 30 08:55:00 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QG44x-0004OT-MQ for ged-emacs-devel@m.gmane.org; Sat, 30 Apr 2011 08:54:59 +0200 Original-Received: from localhost ([::1]:38111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QG44x-0001Qk-23 for ged-emacs-devel@m.gmane.org; Sat, 30 Apr 2011 02:54:59 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QG44t-0001QU-J1 for emacs-devel@gnu.org; Sat, 30 Apr 2011 02:54:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QG44s-0003wX-MJ for emacs-devel@gnu.org; Sat, 30 Apr 2011 02:54:55 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:39448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QG44r-0003wH-Dc; Sat, 30 Apr 2011 02:54:53 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 63E1739E810D; Fri, 29 Apr 2011 23:54:51 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w4iGxpwiep0f; Fri, 29 Apr 2011 23:54:50 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id C5AB339E80F8; Fri, 29 Apr 2011 23:54:50 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 In-Reply-To: <4DBA7F87.5040609@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138921 Archived-At: On 04/29/11 02:06, Paul Eggert wrote: > I will look into extending that patch, so that it also works with > __int64. Here's one way to do that. Add this to nt/config.nt, after the BITS_PER_LONG definition: #if (defined __MINGW32__ \ || 1400 <= _MSC_VER || (1310 <= _MSC_VER && defined _MSC_EXTENSIONS)) /* C99-style long long and "%lld" both work, so use them. */ # define BITS_PER_LONG_LONG 64 #elif 1200 <= _MSC_VER /* Use pre-C99-style 64-bit integers. */ # define EMACS_INT __int64 # define BITS_PER_EMACS_INT 64 # define pI "I64" #endif I inferred the above by looking at random stuff off the net, and haven't actually tested it; quite possibly it's not exactly right for Emacs but something like this should work. Also, I plan to simplify the rats-nest of EMACS_INT ifdefs in lisp.h to the following. This should make this stuff easier to follow. #ifndef EMACS_INT # if BITS_PER_LONG < BITS_PER_LONG_LONG # define EMACS_INT long long # define BITS_PER_EMACS_INT BITS_PER_LONG_LONG # define pI "ll" # elif BITS_PER_INT < BITS_PER_LONG # define EMACS_INT long # define BITS_PER_EMACS_INT BITS_PER_LONG # define pI "l" # else # define EMACS_INT int # define BITS_PER_EMACS_INT BITS_PER_INT # define pI "" # endif #endif #ifndef EMACS_UINT # define EMACS_UINT unsigned EMACS_INT #endif