Skip to content

Commit 5980d6d

Browse files
committed
Fix: Unknown GCC pragmas on Clang
1 parent 4c60177 commit 5980d6d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

include/fork_union.hpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,10 +1445,11 @@ struct arm64_yield_t {
14451445
* Places the core into light sleep mode, waiting for an event to wake it up,
14461446
* or the timeout to expire.
14471447
*/
1448-
#pragma GCC push_options
1449-
#pragma GCC target("arch=armv8-a+wfxt")
14501448
#if defined(__clang__)
14511449
#pragma clang attribute push(__attribute__((target("arch=armv8-a+wfxt"))), apply_to = function)
1450+
#elif defined(__GNUC__)
1451+
#pragma GCC push_options
1452+
#pragma GCC target("arch=armv8-a+wfxt")
14521453
#endif
14531454

14541455
struct arm64_wfet_t {
@@ -1476,9 +1477,10 @@ struct arm64_wfet_t {
14761477
}
14771478
};
14781479

1479-
#pragma GCC pop_options
14801480
#if defined(__clang__)
14811481
#pragma clang attribute pop
1482+
#elif defined(__GNUC__)
1483+
#pragma GCC pop_options
14821484
#endif
14831485

14841486
#endif // FU_DETECT_ARCH_ARM64_
@@ -1489,10 +1491,11 @@ struct x86_pause_t {
14891491
inline void operator()() const noexcept { __asm__ __volatile__("pause"); }
14901492
};
14911493

1492-
#pragma GCC push_options
1493-
#pragma GCC target("waitpkg")
14941494
#if defined(__clang__)
14951495
#pragma clang attribute push(__attribute__((target("waitpkg"))), apply_to = function)
1496+
#elif defined(__GNUC__)
1497+
#pragma GCC push_options
1498+
#pragma GCC target("waitpkg")
14961499
#endif
14971500

14981501
/**
@@ -1531,9 +1534,10 @@ struct x86_tpause_t {
15311534
}
15321535
};
15331536

1534-
#pragma GCC pop_options
15351537
#if defined(__clang__)
15361538
#pragma clang attribute pop
1539+
#elif defined(__GNUC__)
1540+
#pragma GCC pop_options
15371541
#endif
15381542

15391543
#endif // FU_DETECT_ARCH_X86_64_

0 commit comments

Comments
 (0)