diff options
author | Sami Kerola <kerolasa@iki.fi> | 2018-12-18 21:00:24 +0000 |
---|---|---|
committer | Sami Kerola <kerolasa@iki.fi> | 2018-12-18 21:01:48 +0000 |
commit | dc5d75db8351cf2c53386b089e96948ff74c60fe (patch) | |
tree | 0d7b21f98a99f3e7303c732a8e8103bec46593a8 | |
parent | 1c9f77ac19f1ec645d81e4feab2fb7f5e2bba86d (diff) | |
download | iputils-dc5d75db8351cf2c53386b089e96948ff74c60fe.tar.gz |
localization: move nls headers to iputils_common.h
Aboid boilerplating.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r-- | arping.c | 15 | ||||
-rw-r--r-- | clockdiff.c | 15 | ||||
-rw-r--r-- | iputils_common.h | 19 | ||||
-rw-r--r-- | ping.h | 15 | ||||
-rw-r--r-- | tracepath.c | 15 | ||||
-rw-r--r-- | traceroute6.c | 15 |
6 files changed, 24 insertions, 70 deletions
@@ -42,20 +42,7 @@ # include <sys/types.h> #endif -#if defined(USE_IDN) || defined(ENABLE_NLS) -# include <locale.h> -#endif - -#ifdef ENABLE_NLS -# include <libintl.h> -# define _(Text) gettext (Text) -#else -# undef bindtextdomain -# define bindtextdomain(Domain, Directory) /* empty */ -# undef textdomain -# define textdomain(Domain) /* empty */ -# define _(Text) Text -#endif +#include "iputils_common.h" #ifdef USE_IDN # ifndef AI_IDN diff --git a/clockdiff.c b/clockdiff.c index 9035e1c..3de44f6 100644 --- a/clockdiff.c +++ b/clockdiff.c @@ -76,20 +76,7 @@ # include <sys/capability.h> #endif -#ifdef ENABLE_NLS -# include <locale.h> -#endif - -#if ENABLE_NLS -# include <libintl.h> -# define _(Text) gettext (Text) -#else -# undef bindtextdomain -# define bindtextdomain(Domain, Directory) /* empty */ -# undef textdomain -# define textdomain(Domain) /* empty */ -# define _(Text) Text -#endif +#include "iputils_common.h" #define MAX_HOSTNAMELEN NI_MAXHOST diff --git a/iputils_common.h b/iputils_common.h new file mode 100644 index 0000000..40266bc --- /dev/null +++ b/iputils_common.h @@ -0,0 +1,19 @@ +#ifndef IPUTILS_COMMON_H +#define IPUTILS_COMMON_H + +#if defined(USE_IDN) || defined(ENABLE_NLS) +# include <locale.h> +#endif + +#ifdef ENABLE_NLS +# include <libintl.h> +# define _(Text) gettext (Text) +#else +# undef bindtextdomain +# define bindtextdomain(Domain, Directory) /* empty */ +# undef textdomain +# define textdomain(Domain) /* empty */ +# define _(Text) Text +#endif + +#endif /* IPUTILS_COMMON_H */ @@ -40,20 +40,7 @@ #include <sys/capability.h> #endif -#if defined(USE_IDN) || defined(ENABLE_NLS) -# include <locale.h> -#endif - -#ifdef ENABLE_NLS -# include <libintl.h> -# define _(Text) gettext (Text) -#else -# undef bindtextdomain -# define bindtextdomain(Domain, Directory) /* empty */ -# undef textdomain -# define textdomain(Domain) /* empty */ -# define _(Text) Text -#endif +#include "iputils_common.h" #ifdef USE_IDN #include <idn2.h> diff --git a/tracepath.c b/tracepath.c index 6ffe061..8076d4d 100644 --- a/tracepath.c +++ b/tracepath.c @@ -27,20 +27,7 @@ #include <sys/uio.h> #include <unistd.h> -#if defined(USE_IDN) || defined(ENABLE_NLS) -# include <locale.h> -#endif - -#ifdef ENABLE_NLS -# include <libintl.h> -# define _(Text) gettext (Text) -#else -# undef bindtextdomain -# define bindtextdomain(Domain, Directory) /* empty */ -# undef textdomain -# define textdomain(Domain) /* empty */ -# define _(Text) Text -#endif +#include "iputils_common.h" #ifdef USE_IDN # ifndef AI_IDN diff --git a/traceroute6.c b/traceroute6.c index 4bc1dbd..a5f92b5 100644 --- a/traceroute6.c +++ b/traceroute6.c @@ -251,20 +251,7 @@ # include <sys/capability.h> #endif -#if defined(USE_IDN) || defined(ENABLE_NLS) -# include <locale.h> -#endif - -#ifdef ENABLE_NLS -# include <libintl.h> -# define _(Text) gettext (Text) -#else -# undef bindtextdomain -# define bindtextdomain(Domain, Directory) /* empty */ -# undef textdomain -# define textdomain(Domain) /* empty */ -# define _(Text) Text -#endif +#include "iputils_common.h" #ifdef USE_IDN # ifndef NI_IDN |