unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Adrian Robert <arobert@cogsci.ucsd.edu>
Cc: emacs-devel@gnu.org
Subject: Re: #defines and MacOS X
Date: Fri, 28 Oct 2005 11:11:59 -0400	[thread overview]
Message-ID: <24E0809A-1227-4559-A968-75A63ADDD132@cogsci.ucsd.edu> (raw)
In-Reply-To: <wlu0f29xyc.wl%mituharu@math.s.chiba-u.ac.jp>


On Oct 27, 2005, at 10:28 PM, YAMAMOTO Mitsuharu wrote:

>>>>>> On Thu, 27 Oct 2005 13:18:31 -0400, Adrian Robert  
>>>>>> <arobert@cogsci.ucsd.edu> 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..

  reply	other threads:[~2005-10-28 15:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-27 17:18 #defines and MacOS X Adrian Robert
2005-10-28  2:28 ` YAMAMOTO Mitsuharu
2005-10-28 15:11   ` Adrian Robert [this message]
2005-10-28  8:36 ` Kim F. Storm
2005-10-28 11:22   ` Miles Bader
2005-10-28 11:48     ` Kim F. Storm
2005-10-28 15:22   ` Adrian Robert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24E0809A-1227-4559-A968-75A63ADDD132@cogsci.ucsd.edu \
    --to=arobert@cogsci.ucsd.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).