Skip to content

Commit

Permalink
[libc][cdefs] add a few additional features in cdefs
Browse files Browse the repository at this point in the history
This seems to only be needed for older gccs (found with 7.5.0).
  • Loading branch information
travisg committed Feb 27, 2024
1 parent 406f28a commit 8176ae6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/libc/include/sys/cdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,25 @@
#define __BEGIN_DECLS __BEGIN_CDECLS
#define __END_DECLS __END_CDECLS

/*
* Testing against Clang-specific extensions.
*/
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef __has_extension
#define __has_extension __has_feature
#endif
#ifndef __has_feature
#define __has_feature(x) 0
#endif
#ifndef __has_include
#define __has_include(x) 0
#endif
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif

/*-
* Deal with _ANSI_SOURCE:
* If it is defined, and no other compilation environment is explicitly
Expand Down

0 comments on commit 8176ae6

Please sign in to comment.