diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-11-07 14:21:52 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-11-07 14:21:52 -0500 |
commit | c8cb98ec41f0c41ac3b4c3e8be01f12c4c53d3aa (patch) | |
tree | a5abfdbfc328991687ca2fb4bca6a14cbf8f9812 /src | |
parent | b4bcc6bfdfa2b564b0171d437f9988a3159fd58d (diff) | |
download | postgresql-c8cb98ec41f0c41ac3b4c3e8be01f12c4c53d3aa.tar.gz postgresql-c8cb98ec41f0c41ac3b4c3e8be01f12c4c53d3aa.zip |
Move declaration of ecpg_gettext() to a saner place.
Declaring this in the client-visible header ecpglib.h was a pretty
poor decision. It's not meant to be application-callable (and if
it was, putting it outside the extern "C" { ... } wrapper means
that C++ clients would fail to call it). And the declaration would
not even compile for a client, anyway, since it would not have the
macro pg_attribute_format_arg(). Fortunately, it seems that no
clients have tried to include this header with ENABLE_NLS defined,
or we'd have gotten complaints about that. But we have no business
putting such a restriction on client code.
Move the declaration to ecpglib_extern.h, since in fact nothing
outside src/interfaces/ecpg/ecpglib/ needs to call it.
The practical effect of this is just that clients can now safely
#include ecpglib.h while having ENABLE_NLS defined, but that seems
like enough of a reason to back-patch it.
Discussion: https://postgr.es/m/20590.1573069709@sss.pgh.pa.us
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 6 | ||||
-rw-r--r-- | src/interfaces/ecpg/include/ecpglib.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h index f788bfd1eac..4bf55fe3fdf 100644 --- a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h +++ b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h @@ -219,6 +219,12 @@ unsigned ecpg_hex_dec_len(unsigned srclen); unsigned ecpg_hex_enc_len(unsigned srclen); unsigned ecpg_hex_encode(const char *src, unsigned len, char *dst); +#ifdef ENABLE_NLS +extern char *ecpg_gettext(const char *msgid) pg_attribute_format_arg(1); +#else +#define ecpg_gettext(x) (x) +#endif + /* SQLSTATE values generated or processed by ecpglib (intentionally * not exported -- users should refer to the codes directly) */ diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h index a9bc584cd8d..de9c76aefc3 100644 --- a/src/interfaces/ecpg/include/ecpglib.h +++ b/src/interfaces/ecpg/include/ecpglib.h @@ -12,12 +12,6 @@ #include "sqlca.h" #include <string.h> -#ifdef ENABLE_NLS -extern char *ecpg_gettext(const char *msgid) pg_attribute_format_arg(1); -#else -#define ecpg_gettext(x) (x) -#endif - #ifndef __cplusplus #ifndef bool #define bool char |