Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9974d83

Browse files
committedApr 9, 2024
Discard always_inline if __NO_INLINE__ is defined
Workaround a compiler bug in (at least) GCC 4.2.1 if always_inline is used with forward declarations and optimizations are disabled.
1 parent 7f4f604 commit 9974d83

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/attributes.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@
2323
# define unlikely(params) (params)
2424

2525
#else // _MSC_VER
26-
# if zone_has_attribute(always_inline) || zone_has_gnuc(3, 1)
26+
# if (zone_has_attribute(always_inline) || zone_has_gnuc(3, 1)) && ! defined __NO_INLINE__
27+
// Compilation using GCC 4.2.1 without optimizations fails.
28+
// sorry, unimplemented: inlining failed in call to ...
29+
// GCC 4.1.2 and GCC 4.30 compile forward declared functions annotated
30+
// with __attribute__((always_inline)) without problems. Test if
31+
// __NO_INLINE__ is defined and define macro accordingly.
2732
# define really_inline inline __attribute__((always_inline))
2833
# else
2934
# define really_inline inline

0 commit comments

Comments
 (0)
Please sign in to comment.