From: Jakob Leben Date: Wed, 10 Feb 2010 01:30:12 +0000 (+0100) Subject: services_discovery: fix embedding longname in name, take 2 X-Git-Tag: 1.1.0-ff~221 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=af688c8f29ba84096f2e8f752bb5c0e8b4889b7a;p=vlc 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. --- diff --git a/include/vlc_services_discovery.h b/include/vlc_services_discovery.h index a974a53493..9911f6af9f 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); \ } /** @} */