gnustep-dev
[Top][All Lists]
Advanced

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

Re: Legacy applications and headers


From: David Ayers
Subject: Re: Legacy applications and headers
Date: Fri, 19 Mar 2004 16:40:57 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

Marcus Müller wrote:

I'm currently evaluating a migration path from Apple's WebObjects 4.5 to a SOPE/GDL2 based solution. When porting GDL2 to MacOSX Xcode I found out that GDL2 often uses constructs like the following in its headers:

#ifndef NeXT_Foundation_LIBRARY
#include <Foundation/NSArray.h>
#include <Foundation/NSException.h>
#include <Foundation/NSZone.h>
#else
#include <Foundation/Foundation.h>
#endif

This is correct in a GNUstep environment, because some variables concerning library combos and runtime are always defined there.

Using Xcode on MacOSX this is problematic because these variables are not defined automatically. Sometimes it's possible to set these in the respective build environments (Xcode, Makefiles), but this is a tedious step and sometimes, for larger legacy projects, error prone - as I currently experienced.

(For completeness' sake, in the example above, without the manual definition of NeXT_Foundation_LIBRARY the build will fail on MacOSX due to redefinitions of NSArray and the like.)


My request is to change these statements into:

#ifdef GNUSTEP_BASE_LIBRARY
#include <Foundation/NSArray.h>
#include <Foundation/NSException.h>
#include <Foundation/NSZone.h>
#else
#include <Foundation/Foundation.h>
#endif

It won't change anything in the GNUstep environment, however makes a bit difference when using this on MacOSX.


I believe the test was intended to insure when GDL2 is build against other OPENSTEP-like Foundation libraries (like libFoundation maybe) that we only wanted to use the precompiled headers for Apple's Foundation, so therefore we need a test against some marker of that particular Foundation. I was under the impression that NeXT_Foundation_LIBRARY was predefined by the Foundation headers, I guess I was wrong. Maybe there is another marker we could use?

Now as Skyrix seems to have abandoned libFoundation (and I have no idea if GDL2 would have ever worked with it) we might have a true binary situation (ie. either GNUstep or Cocoa). So the proposal may be a practical approach. Yet, I'd like it to be consistent with the -core libraries, so if -core (ie. -baseadd) takes up this convention, -gdl2 and -gsweb can follow. (And as we include -baseadd headers you'll need the consistency also.)

Cheers,
David





reply via email to

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