Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit831ca95

Browse files
committed
Move declaration of ecpg_gettext() to a saner place.
Declaring this in the client-visible header ecpglib.h was a prettypoor decision. It's not meant to be application-callable (and ifit was, putting it outside the extern "C" { ... } wrapper meansthat C++ clients would fail to call it). And the declaration wouldnot even compile for a client, anyway, since it would not have themacro pg_attribute_format_arg(). Fortunately, it seems that noclients have tried to include this header with ENABLE_NLS defined,or we'd have gotten complaints about that. But we have no businessputting such a restriction on client code.Move the declaration to ecpglib_extern.h, since in fact nothingoutside 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 seemslike enough of a reason to back-patch it.Discussion:https://postgr.es/m/20590.1573069709@sss.pgh.pa.us
1 parent5f794f7 commit831ca95

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎src/interfaces/ecpg/ecpglib/extern.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ voidecpg_set_compat_sqlda(int, struct sqlda_compat **, const PGresult *, int,
205205
structsqlda_struct*ecpg_build_native_sqlda(int,PGresult*,int,enumCOMPAT_MODE);
206206
voidecpg_set_native_sqlda(int,structsqlda_struct**,constPGresult*,int,enumCOMPAT_MODE);
207207

208+
#ifdefENABLE_NLS
209+
externchar*ecpg_gettext(constchar*msgid)pg_attribute_format_arg(1);
210+
#else
211+
#defineecpg_gettext(x) (x)
212+
#endif
213+
208214
/* SQLSTATE values generated or processed by ecpglib (intentionally
209215
* not exported -- users should refer to the codes directly) */
210216

‎src/interfaces/ecpg/include/ecpglib.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
#include"sqlca.h"
1313
#include<string.h>
1414

15-
#ifdefENABLE_NLS
16-
externchar*ecpg_gettext(constchar*msgid)pg_attribute_format_arg(1);
17-
#else
18-
#defineecpg_gettext(x) (x)
19-
#endif
20-
2115
#ifndef__cplusplus
2216
#ifndefbool
2317
#definebool char

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp