Re: wip/fs-uae and PySide

Rhialto <[email protected]> Tue, 12 Nov 2013 17:41:38 +0100
Newsgroups gmane.os.netbsd.devel.pkgsrc.wip.general
Message-ID <[email protected]>
--===============5589804610845080440==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="xA/XKXTdy9G3iaIz"
Content-Disposition: inline


--xA/XKXTdy9G3iaIz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
--=20
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl    -- 'this bath is too hot.'


--xA/XKXTdy9G3iaIz
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (NetBSD)

iQEcBAEBAgAGBQJSglpCAAoJEJmJxkVhw/vTrUIIAMA7BkJDDswyilTxlSPklPAQ
LohRlmQ0Kanw+UqfqagWBSYOuWqFikxOzdK9a0s7L5bHgcddo6aykEO7vD1VXZjv
Ybngpgo0OgInMdvyZjPCPYM05+vlULFayCMllX/42a0XyeskacSGxylYCR/sD2NI
75WFykKU9tswu0aPoag/CJXdZBTeaFscf62Ejdca+sV7DihC/uGuttTw3RGeTEsU
8u9GdeQysF5BlgysX9xZ4pV2LReHdGp376CJW1DapIRjCHdTi+nY6NTy6OF0yLeI
7cY60jpcduWTDlAvuX74phUDpjlWuSnPTRDoc9D57CtUU2muPuYv25XPzUaMdeQ=
=o3Hw
-----END PGP SIGNATURE-----

--xA/XKXTdy9G3iaIz--


--===============5589804610845080440==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
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
--===============5589804610845080440==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
pkgsrc-wip-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss

--===============5589804610845080440==--