[comp.windows.x] OBJECTIVE-C COMPILER CLASHES WITH X.H

ISSLCK@NUSVM.BITNET (Law Chee Keong) (12/24/88)

Hi Xperts:

A while back I sent out a message asking for compatibility between X
and Objective-C. I found out that there is actually a clash between the
Objective-C compiler and the X.h file
I'm running the Objective-C 3.3 compiler on a Sun 3/160 running SunOS 3.4
I'm using the MIT XV11.3 of X Windows

I wrote a real simple Objective-C program that includes the header file
Xlib.h (which in turn includes X.h)
The objective-C compiler spits out several "syntax error" messages.

After some hacking, it was discovered that the compiler does not like
nested typedef statements.
In the X.h, at the very beginning, there contains statements like:

typedef unsigned long XID;

typedef XID Window;
typedef XID Font;
    .
    .
    .

Now, I commented out the typedef XID statements and replaced them with:

typedef unsigned long Window;
typedef unsigned long Font;
   .
   .
   .
Now, the Objective-C compiler is happy and everything compiles nicely.

I wish to know if this is perculiar to my system, or has anyone encountered
a similar problem. Anyone from Stepstone listening and would care to
comment?
THanks