From a0e3a36ac49eecf4d529c53efdb994a49bc61084 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 16 Apr 2024 08:54:12 -0300 Subject: src/i18n.h: Change "_()" from a macro to a function --- src/i18n.c | 7 +++++++ src/i18n.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/i18n.c b/src/i18n.c index 0a9d3be..5d5c33a 100644 --- a/src/i18n.c +++ b/src/i18n.c @@ -2,6 +2,8 @@ #include +#include "catalog.h" + #include "i18n.h" @@ -47,3 +49,8 @@ MSGS[] = { [MSG_ERR_VECTOR_OUT_OF_BOUNDS]= "idx (%ld) is beyond bounds (%ld)\n", NULL }; + +const char * +_(const int msg_id) { + return s(MSGS, msg_id); +} diff --git a/src/i18n.h b/src/i18n.h index 2cf992e..0472079 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -42,4 +42,5 @@ enum MSGCATALOG_ID { extern const char *const MSGS[]; -#define _(msg_id) s(MSGS, msg_id) +const char * +_(const int msg_id); -- cgit v1.2.3