🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.objective-c
Article #133

You know what I hate.....

#133
From: David McIntyre
Date: Tue, 23 Oct 1990 23:43
47 lines
2230 bytes
...that Objective-C barfs on the following code:

typedef struct {
        long flags;     /* marks which fields in this structure are defined */
        int x, y;               /* obsolete for new window mgrs, but clients */
        int width, height;      /* should set so old wm's don't mess up */
        int min_width, min_height;
        int max_width, max_height;
        int width_inc, height_inc;
        struct {
                int x;  /* numerator */
                int y;  /* denominator */
        } min_aspect, max_aspect;
        int base_width, base_height;            /* added by ICCCM version 1 */
        int win_gravity;                        /* added by ICCCM version 1 */
} XSizeHints;

The Objective-C processor tries to name the x-y struct the same thing twice,
causing serious problems.  Those used to programming in X will remember the
above code from /mit/lib/X/Xutil.h, in the X11R3/4 distribution.

This causes pains for people trying to use X with Objective-C.

Another problem arises from Object and String, two words defined and used
by both X and Objective-C.  My solution?  I redefined those two words for
the X stuff, thusly:

		#define String XString
		#define Object XObject

		(include all x files here)

		#undef XObject
		#undfe XString

		(include all objective-c stuff here)

And then use the words XString and XObject when dealing with X.  

I reported the first bug to Stepstone a very long time ago (maybe over a
year) but never received either a confirmation, denial or bug fix.  Sigh.

				-Dave

Dave "mr question" McIntyre     |      "....say you're thinking about a plate
mcintyre@turing.cs.rpi.edu      |       of shrimp.....and someone says to
office : 518-276-8633		|	you 'plate,' or 'shrimp'......"
Technical Details
Message-ID: <-T4%8D_@rpi.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!turing.cs.rpi.edu!mcintyre

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!turing.cs.rpi.edu!mcintyre
From: mcintyre@turing.cs.rpi.edu (David McIntyre)
Newsgroups: comp.lang.objective-c
Subject: You know what I hate.....
Message-ID: <-T4%8D_@rpi.edu>
Date: 23 Oct 90 23:43:37 GMT
Reply-To: mcintyre@turing.cs.rpi.edu (David McIntyre)
Organization: Rensselaer Instipoly Technitute
Lines: 47