]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Consistently define _(Str) using dgettext ("elfutils", Str)
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 16 Dec 2020 08:00:00 +0000 (08:00 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 16 Dec 2020 10:01:52 +0000 (10:01 +0000)
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>
18 files changed:
lib/ChangeLog
lib/eu-config.h
lib/xmalloc.c
libasm/ChangeLog
libasm/libasmP.h
libdw/ChangeLog
libdw/libdwP.h
libdwfl/ChangeLog
libdwfl/argp-std.c
libdwfl/libdwflP.h
libebl/ChangeLog
libebl/libeblP.h
libelf/ChangeLog
libelf/libelfP.h
src/ChangeLog
src/unstrip.c
tests/ChangeLog
tests/dwflmodtest.c

index 663a7aa584b02112082d182f3e9dc20ac88beaa1..48b496ce31b8bb1dbdd58197002745ef389f551d 100644 (file)
@@ -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.
index 84b22d7c1f387ad1b6e861ccf2e9cd6ce146fc8d..f0e3d07a6290727e3d2b1f742f980c51687c3bf5 100644 (file)
@@ -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) \
index 0424afc8dcc130375649bda47fb58cf4787e7ea2..7c0949857d56588c3ba1fa8967a9905bcda03734 100644 (file)
 #include <sys/types.h>
 #include "system.h"
 
-#ifndef _
-# define _(str) gettext (str)
-#endif
-
 
 /* Allocate N bytes of memory dynamically, with error checking.  */
 void *
index 78f1baa43d3a77b633a5b70de4ed82eed7fe0fc8..98ac33154c77be23aa07da19adf5939344c3eb6f 100644 (file)
@@ -1,3 +1,7 @@
+2020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * libasmP.h (_): Remove.
+
 2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>
 
        * asm_begin.c (prepare_binary_output): Fix spelling typo in comment.
index 53d8f3a081a925bcd97e4fae76d79a632302bed3..8b72f32b499f8c3458d4b57c93c142a095948c44 100644 (file)
@@ -36,9 +36,6 @@
 
 #include "libdwelf.h"
 
-/* gettext helper macros.  */
-#define _(Str) dgettext ("elfutils", Str)
-
 
 /* Known error codes.  */
 enum
index ab568f55dd652fde32ca15081f264910f1c75cfb..20fec60253d550373b6cbe8aa9c076fefe3c1098 100644 (file)
@@ -1,3 +1,7 @@
+2020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * libdwP.h (_): Remove.
+
 2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>
 
        * dwarf.h: Fix spelling typo in comment.
index c18eea43504714acea4eae58ba9d0675bc846af4..7174ea931f70cf5956ba250fcc9a942874620352 100644 (file)
 #include "atomics.h"
 
 
-/* gettext helper macros.  */
-#define _(Str) dgettext ("elfutils", Str)
-
-
 /* Known location expressions already decoded.  */
 struct loc_s
 {
index fc64eafdf31e826c8fa5d1ee34f7cec44878880d..f9f6f01f068286e8114eb8e40c51e563df12a9ad 100644 (file)
@@ -1,3 +1,8 @@
+2020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * argp-std.c (_): Remove.
+       * libdwflP.h (_): Likewise.
+
 2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>
 
        * libdwfl.h: Fix spelling typos in comments.
index 2aa1b5e01458d8fab851ede5baeec3297b99bac4..01ec18e2182d5db7112143d6d8a54875f72633b7 100644 (file)
@@ -38,9 +38,6 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-/* gettext helper macros.  */
-#define _(Str) dgettext ("elfutils", Str)
-
 
 #define OPT_DEBUGINFO  0x100
 #define OPT_COREFILE   0x101
index 4c6fcb28829fa3e7e5e5a1c82ec33b6def0aa655..4344e356b4529ed95e38a2e6c901cdbe770b2a5f 100644 (file)
@@ -47,9 +47,6 @@
 
 typedef struct Dwfl_Process Dwfl_Process;
 
-/* gettext helper macros.  */
-#define _(Str) dgettext ("elfutils", Str)
-
 #define DWFL_ERRORS                                                          \
   DWFL_ERROR (NOERROR, N_("no error"))                                       \
   DWFL_ERROR (UNKNOWN_ERROR, N_("unknown error"))                            \
index e0862ec36d01cdb8f2fce703f7581f9148e05125..33208f0d8693c6722fae5b7a7daba0b4acdc6762 100644 (file)
@@ -1,3 +1,7 @@
+2020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * libeblP.h (_): Remove.
+
 2020-12-15  Dmitry V. Levin  <ldv@altlinux.org>
 
        * eblbackendname.c (ebl_backend_name): Replace gettext(...) with _(...).
index 599f6378aa824435fb84c7595a79ce0b339c018c..fa1c2c9f5ec483f538fdbd753ee57595789cc7e0 100644 (file)
@@ -86,11 +86,6 @@ struct ebl
 typedef Ebl *(*ebl_bhinit_t) (Elf *, GElf_Half, Ebl *);
 
 
-/* gettext helper macros.  */
-#undef _
-#define _(Str) dgettext ("elfutils", Str)
-
-
 /* LEB128 constant helper macros.  */
 #define ULEB128_7(x)   (BUILD_BUG_ON_ZERO ((x) >= (1U << 7)) + (x))
 
index a280a262ed15d922df310afe0c05ee62f9792f25..dbc99eedb4bf7c2570822f433b0740d33a399b4c 100644 (file)
@@ -1,3 +1,7 @@
+2020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * libelfP.h (_): Remove.
+
 2020-12-15  Mark Wielaard  <mark@klomp.org>
 
        * elf_begin.c (get_shnum): Make sure the full Ehdr is available.
index b8ffa18d4a7c97834925b95e4eb740d7ea122207..fc1aebec8cc44563b099c2f54bf293b31e6d38bd 100644 (file)
@@ -39,9 +39,6 @@
 #include <stdio.h>
 #include <string.h>
 
-/* gettext helper macros.  */
-#define _(Str) dgettext ("elfutils", Str)
-
 
 /* Helper Macros to write 32 bit and 64 bit functions.  */
 #define __elfw2_(Bits, Name) __elf##Bits##_##Name
index 72f70343ed8b713128746072c8de329f99f3c7c3..27e643847959b94ce760a21e8f569591774ffe89 100644 (file)
@@ -1,3 +1,7 @@
+2020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * unstrip.c (_): Remove.
+
 2020-12-15  Mark Wielaard  <mark@klomp.org>
 
        * elflint.c (check_symtab): Always print symbol name (if known)
index 231b941d22faa9249059d87402a21c07eee8572c..85803295f0940605632d717d0808e22693796f18 100644 (file)
 #include "libeu.h"
 #include "printversion.h"
 
-#ifndef _
-# define _(str) gettext (str)
-#endif
-
 /* Name and version of program.  */
 ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
 
index 2c83f6904f36abfab95af847b805821c7ecb3aec..119cf8e771b8a1a255a5d85149b4a2729eb23896 100644 (file)
@@ -1,3 +1,7 @@
+2020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * dwflmodtest.c (N_): Remove.
+
 2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>
 
        * dwarf-die-addr-die.c (main): Fix spelling typo in error diagnostics.
index 9251d1580b00143f2d991dcec14bfcfa8eeb656d..bec8a07c68b4447da0c0bbca90c18b11d4ad98a3 100644 (file)
@@ -204,10 +204,6 @@ print_module (Dwfl_Module *mod __attribute__ ((unused)),
 
 static bool show_functions;
 
-/* gettext helper macro.  */
-#undef N_
-#define N_(Str) Str
-
 static const struct argp_option options[] =
   {
     { "functions", 'f', NULL, 0, N_("Additionally show function names"), 0 },