[1889] in Athena Bugs

home help back first fref pref prev next nref lref last post

update on last saber bug report (preprocessor problems)

daemon@ATHENA.MIT.EDU (Ken Raeburn)
Tue Mar 14 02:13:00 1989

Date: Tue, 14 Mar 89 02:12:42 EST
From: Ken Raeburn <raeburn@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU

After the example I just sent, I tried some ways to get around it:

* Load with -U__STDC__ since that would cause the /**/ version to be
  loaded.  This (reasonably, with option "ansi" set) failed to work.

* Turn off option "ansi", and repeat the last attempted "load" command
  -- which happened to have -U__STDC__.  The "##" version of the macro
  was used.  The source for the macro is:

#if defined(__STDC__) && !defined(UNIXCPP)
#define GetReq(name, req) \
        WORD64ALIGN\
        if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\
                _XFlush(dpy);\
        req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
        req->reqType = X_##name;\
        req->length = (SIZEOF(x##name##Req))>>2;\
        dpy->bufptr += SIZEOF(x##name##Req);\
        dpy->request++

#else  /* non-ANSI C uses empty comment instead of "##" for token concatenation 
*/
#define GetReq(name, req) \
        WORD64ALIGN\
        if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\
                _XFlush(dpy);\
        req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
        req->reqType = X_/**/name;\
        req->length = (SIZEOF(x/**/name/**/Req))>>2;\
        dpy->bufptr += SIZEOF(x/**/name/**/Req);\
        dpy->request++
#endif

...so as far as I can tell, it should have used the second version.
PCC appears to.

-- Ken

home help back first fref pref prev next nref lref last post