aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/extern.h
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2015-03-11 14:19:54 +0100
committerAndres Freund <andres@anarazel.de>2015-03-11 14:30:01 +0100
commitbbfd7edae5aa5ad5553d3c7e102f2e450d4380d4 (patch)
treed230d006ceb7bf350abd5c3c25a89b660a8d3193 /src/interfaces/ecpg/ecpglib/extern.h
parent66ece312f99f384bd33e4342580e78b0eebf0e74 (diff)
downloadpostgresql-bbfd7edae5aa5ad5553d3c7e102f2e450d4380d4.tar.gz
postgresql-bbfd7edae5aa5ad5553d3c7e102f2e450d4380d4.zip
Add macros wrapping all usage of gcc's __attribute__.
Until now __attribute__() was defined to be empty for all compilers but gcc. That's problematic because it prevents using it in other compilers; which is necessary e.g. for atomics portability. It's also just generally dubious to do so in a header as widely included as c.h. Instead add pg_attribute_format_arg, pg_attribute_printf, pg_attribute_noreturn macros which are implemented in the compilers that understand them. Also add pg_attribute_noreturn and pg_attribute_packed, but don't provide fallbacks, since they can affect functionality. This means that external code that, possibly unwittingly, relied on __attribute__ defined to be empty on !gcc compilers may now run into warnings or errors on those compilers. But there shouldn't be many occurances of that and it's hard to work around... Discussion: 54B58BA3.8040302@ohmu.fi Author: Oskari Saarenmaa, with some minor changes by me.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/extern.h')
-rw-r--r--src/interfaces/ecpg/ecpglib/extern.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/ecpglib/extern.h b/src/interfaces/ecpg/ecpglib/extern.h
index ca3bf051816..1fa21fd84ac 100644
--- a/src/interfaces/ecpg/ecpglib/extern.h
+++ b/src/interfaces/ecpg/ecpglib/extern.h
@@ -185,7 +185,7 @@ void ecpg_raise(int line, int code, const char *sqlstate, const char *str);
void ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat);
char *ecpg_prepared(const char *, struct connection *);
bool ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection * conn);
-void ecpg_log(const char *format,...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
+void ecpg_log(const char *format,...) pg_attribute_printf(1, 2);
bool ecpg_auto_prepare(int, const char *, const int, char **, const char *);
void ecpg_init_sqlca(struct sqlca_t * sqlca);