pkgsrc-WIP-discuss archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wip/fs-uae and PySide



I *think* I have found the cause.

The shiboken tool has its own built-in C(++) preprocessor. It has (among
other) the following predefines (in the file
shiboken-1.2.1/ApiExtractor/parser/rpp/pp-qt-configuration):

    #define __cplusplus 1
    #define __STDC__

During the course of preprocessing it may get to <sys/cdefs.h> which
contains


#if __STDC__ || defined(__cplusplus)
    /* some stuff */
#else   /* !(__STDC__ || __cplusplus) */
    /* some other stuff */
/*
 * In non-ANSI C environments, new programs will want ANSI-only C keywords
 * deleted from the program and old programs will want them left alone.
 * Programs using the ANSI C keywords const, inline etc. as normal
 * identifiers should define -DNO_ANSI_KEYWORDS.
 */
#ifndef NO_ANSI_KEYWORDS
#define const           __const         /* convert ANSI C keywords */
#define inline          __inline
#define signed          __signed
#define volatile        __volatile
#endif /* !NO_ANSI_KEYWORDS */
#endif  /* !(__STDC__ || __cplusplus) */


which neatly hides keywords such as const.

It must be the line "#if __STDC__ || defined(__cplusplus)" where the
condition evaluates to false instead of true.

If I change the predefinition of __STDC__ to 1, things fare much better
(although I haven't run a test yet with that as the only change - I
added a lot of instrumentation before I got to this place!)

As I seem to recall, empty preprocessor macros are supposed to evaluate
to 0, in a preprocessor conditional, right?

I'm still looking into the mechanism by which the bug happens. The code
seems to suggest that all identifiers except when inside defined(...)
are simply replaced by 0, but that doesn't explain why my change works.
More instrumentation will be required...

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl    -- 'this bath is too hot.'

Attachment: pgp0VTCDNrAby.pgp
Description: PGP signature

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss


Home | Main Index | Thread Index | Old Index