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 697872 - plugin: fix name expansion in GST_PLUGIN_DEFINE() macro
plugin: fix name expansion in GST_PLUGIN_DEFINE() macro
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-12 13:01 UTC by Gwenole Beauchesne
Modified: 2013-04-13 10:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
plugin: fix name expansion in GST_PLUGIN_DEFINE() macro (992 bytes, patch)
2013-04-12 13:01 UTC, Gwenole Beauchesne
committed Details | Review

Description Gwenole Beauchesne 2013-04-12 13:01:11 UTC
Created attachment 241346 [details] [review]
plugin: fix name expansion in GST_PLUGIN_DEFINE() macro

Hi, this patch makes GST_PLUGIN_DEFINE use G_STRINGIFY() to convert the name argument into a meaningful string. The advantage of this is that `name' can be expanded from other macros defined in the plug-in element.

So, if I have the following:
#define PLUGIN_NAME(NAME) NAME
GST_PLUGIN_DEFINE(major, minor, PLUGIN_NAME(vaapi), ...)

this now expands to "vaapi" instead of PLUGIN_NAME(vaapi) :)

PS: sorry, the padding used to the next '\' is spaces instead of tabs. I can change it to tabs so that to be consistent with surrounding lines.
Comment 1 Tim-Philipp Müller 2013-04-13 10:48:11 UTC
I'm intruiged by your need to make the plugin name a macro, but it seems reasonable enough to use G_STRINGIFY here.

Generally there shouldn't be any tabs anywhere in headers, but let's leave it for someone to clean it all up some other day ;)

 commit f43b756f39fe8fbe90e56b699a80ca3d599a6b1e
 Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
 Date:   Fri Apr 12 14:48:29 2013 +0200

    plugin: fix name expansion for GST_PLUGIN_DEFINE macro
    
    Make GST_PLUGIN_DEFINE use G_STRINGIFY() to convert the name argument
    into a meaningful string. The advantage of this is that `name' can be
    expanded from other macros defined in the plug-in element.
    
    Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697872