mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
Fix unportable usage of __has_attribute
This should fix the breakages caused by 697e1d02f, which seems to break the build for GCC version < 5. It seems, according to the GCC manual that __has_attribute is a "special operator" and must be tested without any other conditions in the preprocessor test. Per recommendation from the GCC manual via Greg Nancarrow Reported-by: Greg Nancarrow Discussion: https://postgr.es/m/CAJcOf-euSu8fhC10v476o9dqnjqKysVs1_vRms-_fvajpZ3kFw@mail.gmail.com
This commit is contained in:
parent
913ec71d68
commit
1fa22a43a5
@ -195,18 +195,25 @@
|
|||||||
* Marking certain functions as "hot" or "cold" can be useful to assist the
|
* Marking certain functions as "hot" or "cold" can be useful to assist the
|
||||||
* compiler in arranging the assembly code in a more efficient way.
|
* compiler in arranging the assembly code in a more efficient way.
|
||||||
*/
|
*/
|
||||||
#if defined(__has_attribute) && __has_attribute (cold)
|
#if defined(__has_attribute)
|
||||||
|
|
||||||
|
#if __has_attribute (cold)
|
||||||
#define pg_attribute_cold __attribute__((cold))
|
#define pg_attribute_cold __attribute__((cold))
|
||||||
#else
|
#else
|
||||||
#define pg_attribute_cold
|
#define pg_attribute_cold
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__has_attribute) && __has_attribute (hot)
|
#if __has_attribute (hot)
|
||||||
#define pg_attribute_hot __attribute__((hot))
|
#define pg_attribute_hot __attribute__((hot))
|
||||||
#else
|
#else
|
||||||
#define pg_attribute_hot
|
#define pg_attribute_hot
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
#define pg_attribute_hot
|
||||||
|
#define pg_attribute_cold
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mark a point as unreachable in a portable fashion. This should preferably
|
* Mark a point as unreachable in a portable fashion. This should preferably
|
||||||
* be something that the compiler understands, to aid code generation.
|
* be something that the compiler understands, to aid code generation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user