[18/25] lib: Use NOT_HAVE_LIBINTL to guard #include <libintl.h>

Message ID 20221020182603.815-19-luoyonggang@gmail.com
State New
Headers
Series Patches for building with mingw/gcc msvc/clang-cl |

Commit Message

Yonggang Luo Oct. 20, 2022, 6:25 p.m. UTC
  Add NOT_HAVE_LIBINTL macro to disable internationalization,
sometimes we have don't want access internationalization such as MSVC,
so the macro NOT_HAVE_LIBINTL can help that.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 lib/eu-config.h | 7 +++++++
 1 file changed, 7 insertions(+)
  

Patch

diff --git a/lib/eu-config.h b/lib/eu-config.h
index 78a5c4fe..5e6c3c72 100644
--- a/lib/eu-config.h
+++ b/lib/eu-config.h
@@ -52,10 +52,17 @@ 
 # define rwlock_unlock(lock) ((void) (lock))
 #endif	/* USE_LOCKS */
 
+#if !defined(NOT_HAVE_LIBINTL)
 #include <libintl.h>
+#endif
+
 /* gettext helper macros.  */
 #define N_(Str) Str
+#if !defined(NOT_HAVE_LIBINTL)
 #define _(Str) dgettext ("elfutils", Str)
+#else
+#define _(Str) N_(Str)
+#endif
 
 /* Compiler-specific definitions.  */
 #define strong_alias(name, aliasname) \