Skip to content

Commit 3601eba

Browse files
nyhwkozaczuk
authored andcommitted
fix compatibility features.h for Fedora 34
Recently (for example in Fedora 34), the C++ header files started to include the system's <single_threaded.h>, and that include <features.h> and assumes it is enough to define __BEGIN_DECLS. However, this macro is actually defined in <sys/cdefs.h>, so we get many build errors like: /usr/include/sys/single_threaded.h:24:1: error: ‘__BEGIN_DECLS’ does not name a type 24 | __BEGIN_DECLS | ^~~~~~~~~~~~~ The fix is to include <sys/cdefs.h> from our compatibility <features.h>. This is what glibc does too. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20210614062057.1998552-2-nyh@scylladb.com>
1 parent 665a0ec commit 3601eba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/glibc-compat/features.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
#include_next <features.h>
1212

13+
/* Recently, some system header files started to rely on <features.h>
14+
* already including <sys/cdefs.h>. So we need to do it.
15+
*/
16+
#include <sys/cdefs.h>
17+
1318
#define hidden __attribute__((__visibility__("hidden")))
1419

1520
#define __GNU_LIBRARY__ 6

0 commit comments

Comments
 (0)