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

Commit1fa22a4

Browse files
committed
Fix unportable usage of __has_attribute
This should fix the breakages caused by697e1d0, which seems to breakthe build for GCC version < 5.It seems, according to the GCC manual that __has_attribute is a "specialoperator" and must be tested without any other conditions in thepreprocessor test.Per recommendation from the GCC manual via Greg NancarrowReported-by: Greg NancarrowDiscussion:https://postgr.es/m/CAJcOf-euSu8fhC10v476o9dqnjqKysVs1_vRms-_fvajpZ3kFw@mail.gmail.com
1 parent913ec71 commit1fa22a4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎src/include/c.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,25 @@
195195
* Marking certain functions as "hot" or "cold" can be useful to assist the
196196
* compiler in arranging the assembly code in a more efficient way.
197197
*/
198-
#if defined(__has_attribute)&&__has_attribute (cold)
198+
#if defined(__has_attribute)
199+
200+
#if__has_attribute (cold)
199201
#definepg_attribute_cold __attribute__((cold))
200202
#else
201203
#definepg_attribute_cold
202204
#endif
203205

204-
#ifdefined(__has_attribute)&&__has_attribute (hot)
206+
#if__has_attribute (hot)
205207
#definepg_attribute_hot __attribute__((hot))
206208
#else
207209
#definepg_attribute_hot
208210
#endif
209211

212+
#else
213+
#definepg_attribute_hot
214+
#definepg_attribute_cold
215+
#endif
216+
210217
/*
211218
* Mark a point as unreachable in a portable fashion. This should preferably
212219
* be something that the compiler understands, to aid code generation.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp