diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2020-12-16 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2020-12-16 10:01:52 +0000 |
commit | 0a5defb64e94ecb2847b98b2c29155131edeaf97 (patch) | |
tree | 2fbbe796e985ad1cefdf4234de8654ce56c14d5e /lib | |
parent | 2e0ae048de8ada585e8ba7d505aad5c3268f8433 (diff) | |
download | elfutils-0a5defb64e94ecb2847b98b2c29155131edeaf97.tar.gz |
Consistently define _(Str) using dgettext ("elfutils", Str)
Move the definition of _(Str) macro to lib/eu-config.h which already
provides a definition of N_(Str) macro. Since lib/eu-config.h is
appended to config.h, it is included into every compilation unit
and therefore both macros are now universally available.
Remove all other definitions of N_(Str) and _(Str) macros from other files
to avoid conflicts and redundancies.
The next step is to replace all uses of gettext(Str) with _(Str).
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ChangeLog | 5 | ||||
-rw-r--r-- | lib/eu-config.h | 3 | ||||
-rw-r--r-- | lib/xmalloc.c | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 663a7aa5..48b496ce 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2020-12-16 Dmitry V. Levin <ldv@altlinux.org> + + * eu-config.h (_): New macro. + * xmalloc.c (_): Remove. + 2020-11-01 Érico N. Rolim <erico.erc@gmail.com> * system.h (ACCESSPERMS): Define macro if it doesn't exist. diff --git a/lib/eu-config.h b/lib/eu-config.h index 84b22d7c..f0e3d07a 100644 --- a/lib/eu-config.h +++ b/lib/eu-config.h @@ -52,8 +52,9 @@ # define rwlock_unlock(lock) ((void) (lock)) #endif /* USE_LOCKS */ -/* gettext helper macro. */ +/* gettext helper macros. */ #define N_(Str) Str +#define _(Str) dgettext ("elfutils", Str) /* Compiler-specific definitions. */ #define strong_alias(name, aliasname) \ diff --git a/lib/xmalloc.c b/lib/xmalloc.c index 0424afc8..7c094985 100644 --- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -36,10 +36,6 @@ #include <sys/types.h> #include "system.h" -#ifndef _ -# define _(str) gettext (str) -#endif - /* Allocate N bytes of memory dynamically, with error checking. */ void * |