Skip to content

Commit 71bc3c2

Browse files
authored
Add a conditional check for the macro __STDC_VERSION__ (#4080)
1 parent 1465c3c commit 71bc3c2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/iwasm/include/wasm_c_api.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extern "C" {
4646
// Auxiliaries
4747

4848
// Machine types
49-
#if (__STDC_VERSION__) > 199901L
49+
#if defined(__STDC_VERSION__) && (__STDC_VERSION__) > 199901L
5050
inline void assertions(void) {
5151
static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
5252
static_assert(sizeof(double) == sizeof(uint64_t), "incompatible double type");

core/shared/utils/bh_assert.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bh_assert_internal(int64 v, const char *file_name, int line_number,
2626
#define __has_extension(a) 0
2727
#endif
2828

29-
#if __STDC_VERSION__ >= 201112L \
29+
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
3030
|| (defined(__GNUC__) && __GNUC__ * 0x100 + __GNUC_MINOR__ >= 0x406) \
3131
|| __has_extension(c_static_assert)
3232

0 commit comments

Comments
 (0)