summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-12-16 08:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-12-16 10:01:52 +0000
commit0a5defb64e94ecb2847b98b2c29155131edeaf97 (patch)
tree2fbbe796e985ad1cefdf4234de8654ce56c14d5e
parent2e0ae048de8ada585e8ba7d505aad5c3268f8433 (diff)
downloadelfutils-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>
-rw-r--r--lib/ChangeLog5
-rw-r--r--lib/eu-config.h3
-rw-r--r--lib/xmalloc.c4
-rw-r--r--libasm/ChangeLog4
-rw-r--r--libasm/libasmP.h3
-rw-r--r--libdw/ChangeLog4
-rw-r--r--libdw/libdwP.h4
-rw-r--r--libdwfl/ChangeLog5
-rw-r--r--libdwfl/argp-std.c3
-rw-r--r--libdwfl/libdwflP.h3
-rw-r--r--libebl/ChangeLog4
-rw-r--r--libebl/libeblP.h5
-rw-r--r--libelf/ChangeLog4
-rw-r--r--libelf/libelfP.h3
-rw-r--r--src/ChangeLog4
-rw-r--r--src/unstrip.c4
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/dwflmodtest.c4
18 files changed, 36 insertions, 34 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 *
diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index 78f1baa4..98ac3315 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -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.
diff --git a/libasm/libasmP.h b/libasm/libasmP.h
index 53d8f3a0..8b72f32b 100644
--- a/libasm/libasmP.h
+++ b/libasm/libasmP.h
@@ -36,9 +36,6 @@
#include "libdwelf.h"
-/* gettext helper macros. */
-#define _(Str) dgettext ("elfutils", Str)
-
/* Known error codes. */
enum
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index ab568f55..20fec602 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -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.
diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index c18eea43..7174ea93 100644
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -38,10 +38,6 @@
#include "atomics.h"
-/* gettext helper macros. */
-#define _(Str) dgettext ("elfutils", Str)
-
-
/* Known location expressions already decoded. */
struct loc_s
{
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index fc64eafd..f9f6f01f 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -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.
diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c
index 2aa1b5e0..01ec18e2 100644
--- a/libdwfl/argp-std.c
+++ b/libdwfl/argp-std.c
@@ -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
diff --git a/libdwfl/libdwflP.h b/libdwfl/libdwflP.h
index 4c6fcb28..4344e356 100644
--- a/libdwfl/libdwflP.h
+++ b/libdwfl/libdwflP.h
@@ -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")) \
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index e0862ec3..33208f0d 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -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 _(...).
diff --git a/libebl/libeblP.h b/libebl/libeblP.h
index 599f6378..fa1c2c9f 100644
--- a/libebl/libeblP.h
+++ b/libebl/libeblP.h
@@ -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))
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index a280a262..dbc99eed 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -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.
diff --git a/libelf/libelfP.h b/libelf/libelfP.h
index b8ffa18d..fc1aebec 100644
--- a/libelf/libelfP.h
+++ b/libelf/libelfP.h
@@ -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
diff --git a/src/ChangeLog b/src/ChangeLog
index 72f70343..27e64384 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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)
diff --git a/src/unstrip.c b/src/unstrip.c
index 231b941d..85803295 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -52,10 +52,6 @@
#include "libeu.h"
#include "printversion.h"
-#ifndef _
-# define _(str) gettext (str)
-#endif
-
/* Name and version of program. */
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 2c83f690..119cf8e7 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -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.
diff --git a/tests/dwflmodtest.c b/tests/dwflmodtest.c
index 9251d158..bec8a07c 100644
--- a/tests/dwflmodtest.c
+++ b/tests/dwflmodtest.c
@@ -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 },