static check for feature compat in coroutine.h

This commit is contained in:
Alessandro Mauri 2026-05-29 19:04:23 +02:00
parent ec65e297fd
commit a1550d636a
2 changed files with 13 additions and 0 deletions

View File

@ -113,6 +113,18 @@
*/ */
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
// GCC: the extension is always present unless strict ANSI mode is forced.
// (Even with -pedantic it still works, just warns.)
#define HAVE_LABELS_AS_VALUES 1
#elif __has_extension(c_labels_as_values)
#define HAVE_LABELS_AS_VALUES 1
#else
#define HAVE_LABELS_AS_VALUES 0
#endif
_Static_assert(HAVE_LABELS_AS_VALUES, "This library requires the GNU C 'labels as values' extension");
// Useful macros // Useful macros
#define CORO_CONCAT2(s1, s2) s1##s2 #define CORO_CONCAT2(s1, s2) s1##s2
#define CORO_CONCAT(s1, s2) CORO_CONCAT2(s1, s2) #define CORO_CONCAT(s1, s2) CORO_CONCAT2(s1, s2)

View File

@ -10,6 +10,7 @@
#include "sc7a20.h" #include "sc7a20.h"
#include "pd.h" #include "pd.h"
#include "fpmath.h" #include "fpmath.h"
#include "coroutine.h"
// constants // constants