Skip to content

Commit

Permalink
common: detect compilers with extensions off
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Jan 4, 2025
1 parent eaef12d commit 25e8aca
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions include/stc/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,16 @@ typedef ptrdiff_t isize;
typedef int64_t int64;
typedef uint64_t uint64;
#endif
#if !defined STC_HAS_TYPEOF && (_MSC_FULL_VER >= 193933428 || \
defined __GNUC__ || defined __clang__ || defined __TINYC__)
#define STC_HAS_TYPEOF 1
#ifndef STC_HAS_TYPEOF
#ifdef __clang__
#if !__is_identifier(__typeof__)
#define STC_HAS_TYPEOF
#endif
#elif defined(__TINYC__) || _MSC_FULL_VER >= 193933428
#define STC_HAS_TYPEOF
#elif defined(__GNUC__) && __has_builtin(__typeof__)
#define STC_HAS_TYPEOF
#endif
#endif
#if defined __GNUC__ || defined __clang__
#define STC_INLINE static inline __attribute((unused))
Expand Down

0 comments on commit 25e8aca

Please sign in to comment.