Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!think!husc6!spdcc!bloom-beacon!inesc.UUCP!xsmd From: xsmd@inesc.UUCP (Manuel Sequeira ; MDS) Newsgroups: comp.windows.x Subject: Re: C++ and X11 Message-ID: <8811021007.AA19158@mcvax.cwi.nl> Date: 1 Nov 88 19:07:44 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 35 Date: 31 Oct 88 22:01:21 GMT From: mcvax!june.cs.washington.edu!whaley (Ken Whaley) Has anybody out there written a C++ interface to X11? I.e., doctored up the ".h" files so that CC likes them? Yes we've done that. There were two problems to solve: 1. Struct component names: new, delete, class. we solved that by including two files in every ".h" X file which used such fields. - one at the beginning defining new, delete, and class as Xnew, Xdelete, and Xclass. - another at the end undefining the previous definitions. Ramifications: if it is necessary to reference such fields in our code we use Xnew etc. instead. 2. Functions Specification. As c++ was annoyed by the the C declarations in the ".h" X we deleted them. To avoid errors and warnings generated by the compiler, we specified the functions in others ".h" files (hidden to the user) and included by the usual ".h" X files. Since this specification task was not a very gratifing job to accomplish by hand, a mechanism was developed that using emacs macros, shell scripts and ".f" files (used to build the manual), somewhat automatized the process. Ramifications: None whatsoever. We have been using this since X11R1, and the approach used facilitated the upgrade to X11R2. -manel ..mcvax!inesc!xsmd