[vlc-devel] commit: Include <libintl.h> only when really needed ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Apr 16 10:24:58 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 16 11:23:46 2009 +0300| [1e9c9c83889e2b93dde605432fd67a04fdbfd7d5] | committer: Rémi Denis-Courmont 

Include <libintl.h> only when really needed

Especially, plugins are not supposed to link with -lintl directly.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1e9c9c83889e2b93dde605432fd67a04fdbfd7d5
---

 include/vlc_fixups.h |    4 ----
 src/extras/libc.c    |    5 +++++
 src/libvlc.c         |    5 +++++
 src/modules/entry.c  |    5 +++++
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 983ebd8..ead019d 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -179,10 +179,6 @@ typedef void *locale_t;
 #define gettext(str)     vlc_gettext (str)
 #define pgettext(ctx,id) vlc_pgettext(ctx,id)
 
-#if defined (ENABLE_NLS)
-# include <libintl.h>
-#endif
-
 #define N_(str) gettext_noop (str)
 #define gettext_noop(str) (str)
 
diff --git a/src/extras/libc.c b/src/extras/libc.c
index 28ed517..8e36fe0 100644
--- a/src/extras/libc.c
+++ b/src/extras/libc.c
@@ -191,6 +191,11 @@ int vlc_wclosedir( void *_p_dir )
 #endif
 }
 
+#ifdef ENABLE_NLS
+# undef gettext
+# include <libintl.h>
+#endif
+
 /**
  * In-tree plugins share their gettext domain with LibVLC.
  */
diff --git a/src/libvlc.c b/src/libvlc.c
index 75041c1..f6d6be8 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -66,6 +66,11 @@
 #   include <locale.h>
 #endif
 
+#ifdef ENABLE_NLS
+# undef gettext
+# include <libintl.h> /* bindtextdomain */
+#endif
+
 #ifdef HAVE_DBUS
 /* used for one-instance mode */
 #   include <dbus/dbus.h>
diff --git a/src/modules/entry.c b/src/modules/entry.c
index a9a7e7d..dd83550 100644
--- a/src/modules/entry.c
+++ b/src/modules/entry.c
@@ -28,6 +28,11 @@
 #include <assert.h>
 #include <stdarg.h>
 
+#ifdef ENABLE_NLS
+# undef gettext
+# include <libintl.h>
+#endif
+
 #include "modules/modules.h"
 #include "config/configuration.h"
 #include "libvlc.h"




More information about the vlc-devel mailing list