[Top][All Lists]

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

Re: Cocoa compatability header file

From: Fred Kiefer
Subject: Re: Cocoa compatability header file
Date: Wed, 21 Apr 2004 13:00:34 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040220

Kazunobu Kuriyama wrote:
Fred Kiefer wrote:

Kazunobu Kuriyama wrote:

The general idea looks ok. But are you sure the proposed header can live with C99 and (reportedly coming) ObjC++? I mean, the typedef and the following define's
seem to be problematic.

No, I am not sure. If you have any suggestions on how to make this header file safer against upcoming compiler changes these are very welcome.

Honestly, I know almost nothing about ObjC++. So I'm happy if someone who knows the
stuff well corrects mistakes possibly made in the code below.

Since bool has been a predefined type in C++ and C99 (AFAIK, as of GCC 3.1 for the
latter), I think the following makes the thing safer:

#if __GNUC__ > 3
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCH_LEVEL__)
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)

#if (!defined(__cplusplus)) || GCC_VERSION < 30100
typedef BOOL bool
#define false NO
#define true  YES

The strange thing is that I am using GCC 3.3.1 and these where not defined for me. What about checking __USE_ISOC99 instead? I really don't have much of a glue here, so this is just guessing.

(In my view, this sort of stuff should go into a header which is supposed to be included in almost all of the GNUstep headers, say GSConfig.h. Is this wrong?)

As I wrote, I don't want to see these names being used in normal GNUstep code. It is better to keep the definitions out ouf our normal headers, otherwise we would encourage people to use them.

reply via email to

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