discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Portability/Compatability between GNUstep <---> Cocoa...


From: Richard Frith-Macdonald
Subject: Re: Portability/Compatability between GNUstep <---> Cocoa...
Date: Mon, 12 Jan 2004 15:42:46 +0000


On 12 Jan 2004, at 15:29, Kazunobu Kuriyama wrote:

Richard Frith-Macdonald wrote:


On 12 Jan 2004, at 13:50, Kazunobu Kuriyama wrote:

Recently, I've made some non-trivial programs based on some Cocoa programming books and found some concrete incompatiblilities between GNUstep and Cocoa. When I come across such an incompatibility, I'm always at a loss because GNUstep doesn't provide any preprocessor macro which can be used just for differentiating GNUstep code and Cocoa one. I feel both STRICT_OPENSTEP and NO_GNUSTEP or their
negations are not appropriate for that purpose.


Use STRICT_MACOS_X

OK, I undestand that stuff well. But is this macro defined in Cocoa's headers, too? Otherwise, I feel the instruction above is applied to code written only for GNUstep,
not for code compatible with both GNUstep and Cocoa.

In addition, my question is about real incompatibility, not about any class/method found both in GNUstep and Cocoa. I seek for such a predefined macro that enables a conditional complication like

#if defined SOME_MACRO
   <GNUstep-proper code comes here>
#else
   <Cocoa-proper code comes here>
#endif

In other words, I seek for a macro which differentiate GNUstep headers and Cocoa ones, not a macro which can be used to decide whether GNUstep's Cocoa API is used or not.

There are two completely different issues here then ...
The macros in the GNUstep headers are intended to allow you to develop code under GNUstep which will run under (say) MacOS-X ... because by defining a single value in your build, you prevent the compiler from seeing (and hence your code from using) any feature which is not
available under MacOS-X

There should be no need for conditional compilation within application code because, if you use a MacOS-X specific feature which is not already in GNUstep, you can implement it and contribute it to GNUstep. If you use a GNUstep feature not natively in MacOS-X, you should be able to build your code on MacOS-X with the GNUstep-base additions library so that it *is*
available on MacOS-X.

If you can't/won't contribute the code to GNUstep, you *can* put conditional compilation in your code based on the 'GNUSTEP' macro which is predefined by the GNUstep make
system when the base library is used.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]