[comp.windows.x] Using Xt with C++

nazgul@alphalpha.COM (Kee Hinckley) (09/02/90)

I'm confused as to how prototypes can be turned on by default
in Xt.  I can clearly do it using XTFUNCPROTO, but this shouldn't
be necessary in C++.

Intrinsic.h includes the following:

#include        <X11/Xlib.h>
#include        <X11/Xutil.h>
#include        <X11/Xresource.h>
#include        <X11/Xos.h>

#define XtSpecificationRelease 4

#ifdef XTFUNCPROTO
#undef NeedFunctionPrototypes
#define NeedFunctionPrototypes 1
#else
#undef NeedFunctionPrototypes
#define NeedFunctionPrototypes 0
#undef NeedWidePrototypes
#define NeedWidePrototypes 0
#endif

#ifndef NeedFunctionPrototypes
#if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplus
plus) || defined(c_plusplus)
#define NeedFunctionPrototypes 1
#else
#define NeedFunctionPrototypes 0
#endif /* __STDC__ */
#endif /* NeedFunctionPrototypes */


Xlib.h will define NeedFunctionPrototypes because it sees that
I'm running C++.  That's fine.  Now we get back to Intrinsic.h
XTFUNCPROTO isn't defined, so we skip to the else.  That undefines
NeedFunctionPrototypes and then defines it to 0.  However the
check to see if I'm running C++ and *really* need them is inside
an ifndef NeedFunctionPrototypes.  I can't see anyway that that
test (for __STDC__ or __cplus...) will ever get executed unless
I explicitly define XTFUNCPROTO.  I can do that, but it doesn't
seem like I should have to.

Comments?