Changeset 5f2dd73ec8e68b0191d251ec80dc220b70624719

Show
Ignore:
Timestamp:
22/05/08 21:46:11 (5 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1211485571 +0300
git-parent:

[a6ab35eee2d88fda9c3e0397504547f01c88bf5a]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1211485571 +0300
Message:

Provide vlc_gettext on all platforms

This avoids having to link a few plugins with libintl on platforms where
it's not built-in libc. This also factors the internal use of
dgettext("vlc", ...).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_common.h

    ra6ab35e r5f2dd73  
    890890 *****************************************************************************/ 
    891891#ifdef WIN32 
    892     VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) ); 
    893 #endif 
     892VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) ); 
     893#endif 
     894VLC_EXPORT( char *, vlc_gettext, ( const char *msgid ) ); 
    894895 
    895896/***************************************************************************** 
  • include/vlc_fixups.h

    ra6ab35e r5f2dd73  
    164164 
    165165/* libintl support */ 
    166 #define _(str) dgettext (PACKAGE_NAME, str) 
     166#define _(str) vlc_gettext (str) 
    167167 
    168168#if defined (ENABLE_NLS) 
    169169# include <libintl.h> 
    170 # ifdef WIN32 
    171 #  undef _ 
    172 #  define _(str) vlc_dgettext (PACKAGE_NAME, str) 
    173 # endif 
    174170#else 
    175 # define dgettext(dom, str) (str
     171# define dgettext(dom, str) ((char *)(str)
    176172#endif 
    177173 
  • src/extras/libc.c

    rd1d3dc1 r5f2dd73  
    608608#endif 
    609609 
    610 #ifdef WIN32 
    611 /***************************************************************************** 
    612  * dgettext: gettext for plugins. 
    613  *****************************************************************************/ 
     610#if defined (WIN32) 
     611/** 
     612 * gettext callbacks for plugins. 
     613 * LibVLC links libintl statically on Windows. 
     614 */ 
    614615char *vlc_dgettext( const char *package, const char *msgid ) 
    615616{ 
    616 #if defined( ENABLE_NLS ) \ 
    617      && ( defined(HAVE_GETTEXT) || defined(HAVE_INCLUDED_GETTEXT) ) 
    618617    return dgettext( package, msgid ); 
    619 #else 
    620     return (char *)msgid; 
    621 #endif 
    622 
    623 #endif 
     618
     619#endif 
     620 
     621/** 
     622 * In-tree plugins share their gettext domain with LibVLC. 
     623 */ 
     624char *vlc_gettext( const char *msgid ) 
     625
     626    return dgettext( PACKAGE_NAME, msgid ); 
     627
    624628 
    625629/***************************************************************************** 
  • src/libvlccore.sym

    r59dec65 r5f2dd73  
    405405vlc_getenv 
    406406vlc_getnameinfo 
     407vlc_gettext 
    407408vlc_iconv 
    408409vlc_iconv_close