1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Detect PG_PRINTF_ATTRIBUTE automatically.

This eliminates gobs of "unrecognized format function type" warnings
under MinGW compilers predating GCC 4.4.
This commit is contained in:
Noah Misch
2014-11-23 09:34:03 -05:00
parent b62f94c603
commit b779168ffe
5 changed files with 61 additions and 16 deletions

View File

@@ -187,22 +187,6 @@
*/
#define MAX_RANDOM_VALUE (0x7FFFFFFF)
/*
* Set the format style used by gcc to check printf type functions. We really
* want the "gnu_printf" style set, which includes what glibc uses, such
* as %m for error strings and %lld for 64 bit long longs. But not all gcc
* compilers are known to support it, so we just use "printf" which all
* gcc versions alive are known to support, except on Windows where
* using "gnu_printf" style makes a dramatic difference. Maybe someday
* we'll have a configure test for this, if we ever discover use of more
* variants to be necessary.
*/
#ifdef WIN32
#define PG_PRINTF_ATTRIBUTE gnu_printf
#else
#define PG_PRINTF_ATTRIBUTE printf
#endif
/*
* On PPC machines, decide whether to use the mutex hint bit in LWARX
* instructions. Setting the hint bit will slightly improve spinlock