After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698367 - Respect __GI_SCANNER__ for macros
Respect __GI_SCANNER__ for macros
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-04-19 14:31 UTC by Stef Walter
Modified: 2015-02-07 16:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
giscanner: Respect __GI_SCANNER__ when scanning for macros (9.53 KB, patch)
2013-04-19 15:00 UTC, Stef Walter
none Details | Review
giscanner: Respect __GI_SCANNER__ when scanning for macros (9.38 KB, patch)
2013-04-19 16:47 UTC, Stef Walter
none Details | Review
giscanner: Respect __GI_SCANNER__ when scanning for macros (9.67 KB, patch)
2013-10-19 19:44 UTC, Stef Walter
none Details | Review
giscanner: Respect __GI_SCANNER__ when scanning for macros (11.10 KB, patch)
2013-10-20 17:50 UTC, Stef Walter
committed Details | Review
giscanner: Respect __GI_SCANNER__ when scanning for macros (10.95 KB, patch)
2013-11-02 14:22 UTC, Stef Walter
none Details | Review

Description Stef Walter 2013-04-19 14:31:04 UTC
Sometimes headers have #define lines that are not namespaced for the current library. It should be possible to use this to suppress:

#ifndef __GI_SCANNER__
...
#endif
Comment 1 Stef Walter 2013-04-19 15:00:11 UTC
Created attachment 241918 [details] [review]
giscanner: Respect __GI_SCANNER__ when scanning for macros

When scanning for macros respect ifdefs of __GI_SCANNER__
in the various header files. Only #ifdef and #ifndef are supported.
If __GI_SCANNER__ appears in plain #if statements, a warning is
printed.
Comment 2 Stef Walter 2013-04-19 16:43:36 UTC
Patch tested on master and gnome-3-6. Also applies to gnome-3-8.
Comment 3 Stef Walter 2013-04-19 16:47:06 UTC
Created attachment 241929 [details] [review]
giscanner: Respect __GI_SCANNER__ when scanning for macros

When scanning for macros respect ifdefs of __GI_SCANNER__
in the various header files. Only #ifdef and #ifndef are supported.
If __GI_SCANNER__ appears in plain #if statements, a warning is
printed.
Comment 4 Stef Walter 2013-10-19 19:44:02 UTC
Created attachment 257730 [details] [review]
giscanner: Respect __GI_SCANNER__ when scanning for macros

When scanning for macros respect ifdefs of __GI_SCANNER__
in the various header files. Only #ifdef and #ifndef are supported.
If __GI_SCANNER__ appears in plain #if statements, a warning is
printed.
Comment 5 Stef Walter 2013-10-19 19:44:17 UTC
Rebased onto master.
Comment 6 Stef Walter 2013-10-20 17:50:16 UTC
Created attachment 257773 [details] [review]
giscanner: Respect __GI_SCANNER__ when scanning for macros

Added tests, refactored for simpler implementation.
Comment 7 Colin Walters 2013-10-21 18:19:48 UTC
Review of attachment 257773 [details] [review]:

This looks good.  I assume you got my original review comment, even though bugzilla appears to have lost it after the outage.  

Just for posterity, the original comment was:

"This looks clean and is well written.  I assume it's been tested on a codebase of yours?  But i'm a little worried at having no tests in g-i itself.  If you think it's been tested enough outside I'm fine with applying, but I'd also be happy to have tests =)"

Looks like all comments are addressed now, thank you!
Comment 8 Stef Walter 2013-10-21 18:44:11 UTC
Attachment 257773 [details] pushed as 917da2d - giscanner: Respect __GI_SCANNER__ when scanning for macros
Comment 9 Stef Walter 2013-10-21 18:44:51 UTC
Thanks for the review. Pushed. Oddly enough I didn't receive your previous comment.
Comment 10 Stef Walter 2013-11-02 14:22:52 UTC
Created attachment 258801 [details] [review]
giscanner: Respect __GI_SCANNER__ when scanning for macros

Patch for gnome-3-8 branch
Comment 11 André Klapper 2015-02-07 16:46:02 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]