Path: utzoo!attcan!uunet!hsi!stpstn!lerman From: lerman@stpstn.UUCP (Ken Lerman) Newsgroups: comp.lang.objective-c Subject: Re: You know what I hate..... Message-ID: <5711@stpstn.UUCP> Date: 24 Oct 90 11:49:30 GMT References: <-T4%8D_@rpi.edu> Sender: uucp@stpstn.UUCP Reply-To: lerman@stpstn.UUCP (Ken Lerman) Organization: The Stepstone Corporation, Sandy Hook, CT 06482 Lines: 70 In article <-T4%8D_@rpi.edu> mcintyre@turing.cs.rpi.edu (David McIntyre) writes: ->...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. This is a known bug involving the generation of code for anonymous structures which has been fixed for the next release. -> ->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. Unfortunately, there is no standard naming authority for external names for C programs. It is small consolation for Stepstone that we used those names before X. The problem becomes more severe when you are using libraries with conflicting names and you don't have the source. That is not a problem with either X or Stepstone's Objective-C Libraries. The approach you've mentioned is roughly what we recommend. -> ->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. You should have received a confirmation. -> -> -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'......" I speak the truth, but without the official blessing of Stepstone in this matter. Ken