Skip to content

Commit

Permalink
fix compatibility features.h for Fedora 34
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nyh authored and wkozaczuk committed Jun 14, 2021
1 parent 665a0ec commit 3601eba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/glibc-compat/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

#include_next <features.h>

/* Recently, some system header files started to rely on <features.h>
* already including <sys/cdefs.h>. So we need to do it.
*/
#include <sys/cdefs.h>

#define hidden __attribute__((__visibility__("hidden")))

#define __GNU_LIBRARY__ 6
Expand Down

0 comments on commit 3601eba

Please sign in to comment.