From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adrian Robert Newsgroups: gmane.emacs.devel Subject: Re: #defines and MacOS X Date: Fri, 28 Oct 2005 11:11:59 -0400 Message-ID: <24E0809A-1227-4559-A968-75A63ADDD132@cogsci.ucsd.edu> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v734) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1130514350 3232 80.91.229.2 (28 Oct 2005 15:45:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Oct 2005 15:45:50 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 28 17:45:47 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EVWPy-0002FG-U7 for ged-emacs-devel@m.gmane.org; Fri, 28 Oct 2005 17:45:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EVWPy-0007xC-A1 for ged-emacs-devel@m.gmane.org; Fri, 28 Oct 2005 11:45:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EVVtv-0005Cv-T9 for emacs-devel@gnu.org; Fri, 28 Oct 2005 11:12:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EVVtu-0005CZ-Rw for emacs-devel@gnu.org; Fri, 28 Oct 2005 11:12:15 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EVVtu-0005CU-Ek for emacs-devel@gnu.org; Fri, 28 Oct 2005 11:12:14 -0400 Original-Received: from [140.251.1.25] (helo=smtp-in1.med.cornell.edu) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EVVtk-00064F-92 for emacs-devel@gnu.org; Fri, 28 Oct 2005 11:12:14 -0400 Original-Received: from mpx2.med.cornell.edu (pc113142-10.med.cornell.edu [140.251.11.119]) by smtp-in1.med.cornell.edu (Switch-3.1.6/Switch-3.1.6) with ESMTP id j9SFC0i6214042 for ; Fri, 28 Oct 2005 11:12:00 -0400 Original-Received: from [140.251.33.115] by mpx2.med.cornell.edu (Sun Java System Messaging Server 6.1 HotFix 0.11 (built Jan 28 2005)) with ESMTP id <0IP200M7YSW0T7D0@mpx2.med.cornell.edu> for emacs-devel@gnu.org; Fri, 28 Oct 2005 11:12:00 -0400 (EDT) In-reply-to: Original-To: YAMAMOTO Mitsuharu X-Mailer: Apple Mail (2.734) X-PMX-Version: 4.7.1.128075, Antispam-Engine: 2.1.0.0, Antispam-Data: 2005.10.28.13 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45032 Archived-At: On Oct 27, 2005, at 10:28 PM, YAMAMOTO Mitsuharu wrote: >>>>>> On Thu, 27 Oct 2005 13:18:31 -0400, Adrian Robert >>>>>> said: >>>>>> > > >> One issue that comes up is #ifdef constant naming semantics, because >> the both ports have historically assumed they are the only windowing >> system port on the Mac, and therefore used constants like "MAC_OS" >> to delineate their code. >> > > I'm not sure it is a good time to change them for Emacs 22, but their > convention is actually inconsistent. It can wait if that's what people prefer. It doesn't make sense to do it on unicode-2 and not head due to hindering merging as mentioned in another message. Also, I'm beginning to think (see below) perhaps someone more familiar with the Mac code than I should handle this, but I don't want to cause any delays of the 22 release. >> In particular, the Carbon port uses: >> > > I think there are some misunderstandings in this part. > > First, Mac OS Classic has Carbon and non-Carbon ports. The Carbon > port is almost a superset of the non-Carbon one, but emulation of > synchronous processes is not available on the former. Mac OS X > currently has terminal-only, X11, and Carbon ports. Let me clarify > the current situation using them. I'm confused, because I thought "Carbon" referred to an API on OS X only that allowed OS 8/9 apps to be recompiled (with small modifications) and run on OS X. Thus, I had been thinking the following were the only three cases: - Mac running OS 8/9 w/o OS X installed -- "Classic non-Carbon"? - Mac running app in "classic" emulation mode on OS X -- still "Classic non-Carbon"? - Mac running app on OS X w/o emulation -- "Carbon"? But I guess I'm wrong. Which of these correspondences are right? And what machine does a "Classic Carbon" app run on? >> MAC_OS_8, MAC_OS_9 >> - non-graphical code relevant on MacOS 8/9 >> > > The current code does not distinguish Mac OS 8 from 9. Maybe > MAC_OS_CLASSIC can be used here. There are a number of cases in the code currently where MAC_OS8 is checked for. Are you saying Mac OS 8 AND 9 both define this, but Carbon on OS X doesn't? >> DARWIN >> - non-graphical code relevant on MacOS X, as well as other Darwin >> BSD distributions >> > > `DARWIN' should not be defined on Mac OS X because CoreFoundation.h > uses it to distinguish Mac OS X from bare Darwin. OK, that's unfortunate. In emacs, it's a little confusing since the MacOSX ports use 's/darwin.h'. (What do the 8/9 ports use, BTW?) It's not a big deal, but maybe at some point s/macosx.h should be created (inheriting from darwin.h, or maybe bsd4-3.h), with a corresponding distinction in the 'SYSTEM_TYPE' variable. Does GNU emacs support building on Darwin / non-MacOSX systems? > What we'd like to distinguish is: > > - Between (Classic/Carbon or OSX/Carbon) and Classic/non-Carbon > - Between OSX/Carbon and Classic/Carbon > > I think they can be achieved using standard macros TARGET_API_MAC_OS8, > TARGET_API_MAC_OSX, and TARGET_API_MAC_CARBON. (Note that they can > only be used on Classic/non-Carbon, Classic/Carbon and OSX/Carbon > after a relevant header file is included). I'll look into whether there are corresponding useful predefined constants in the Cocoa and GNUstep headers..