[vlc-devel] commit: services_discovery: fix embedding longname in name, take 2 ( Jakob Leben )
git version control
git at videolan.org
Wed Feb 10 02:35:48 CET 2010
vlc | branch: master | Jakob Leben <jleben at videolan.org> | Wed Feb 10 02:30:12 2010 +0100| [af688c8f29ba84096f2e8f752bb5c0e8b4889b7a] | committer: Jakob Leben
services_discovery: fix embedding longname in name, take 2
The longname argument to macro #define VLC_SD_PROBE_HELPER(name, longname, cat)
is usually in the form like N_("some_longname"). Literalization of the argument by
doing # longname in the macro will result in a literal "N_(\"some_longname\")"
instead of translating the long name.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=af688c8f29ba84096f2e8f752bb5c0e8b4889b7a
---
include/vlc_services_discovery.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/vlc_services_discovery.h b/include/vlc_services_discovery.h
index a974a53..9911f6a 100644
--- a/include/vlc_services_discovery.h
+++ b/include/vlc_services_discovery.h
@@ -109,9 +109,10 @@ VLC_EXPORT(int, vlc_sd_probe_Add, (vlc_probe_t *, const char *, const char *, in
#define VLC_SD_PROBE_HELPER(name, longname, cat) \
static int vlc_sd_probe_Open (vlc_object_t *obj) \
{ \
+ char psz_name[ strlen( name ) + strlen( longname ) + 20 ]; \
+ sprintf( psz_name, "%s{longname=\"%s\"}", name, longname ); \
return vlc_sd_probe_Add ((struct vlc_probe_t *)obj, \
- name "{longname=\"" # longname "\"}", \
- longname, cat); \
+ psz_name, longname, cat); \
}
/** @} */
More information about the vlc-devel
mailing list