Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/shared/platform/include/platform_wasi_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
#endif /* _Alignof */

extern "C" {
#elif defined(_MSC_VER) && !_CRT_HAS_C11
#define _Static_assert static_assert
#define _Alignof __alignof
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMM, how about?

#ifdef __cplusplus
extern "C" {
#endif

#ifndef _Static_assert
#define _Static_assert static_assert
#endif /* _Static_assert */

#ifndef _Alignof
#if defined(_MSC_VER) && !_CRT_HAS_C11
#define _Alignof __alignof
#else
#define _Alignof alignof
#endif
#endif /* _Alignof */

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This make a lot error. So I revert it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask about the error? the modification I apologize for the confusion. My intention is to expand the compatibility of _Static_assert and _Align_of.

As far as I know, if __cplusplus >= 201103L, static_assert is a keyword. if __STDC_VERSION__ >= 201112L, _Static_assert is a keyword. Both __GNUC__ and __clang__ support _Static_assert since version 4.6, and if _MSC_VER >= 1600 supports _Static_assert for both C++ and C.

Therefore, we might need to reorganize to cover all these cases.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors are here: https://github.com/bytecodealliance/wasm-micro-runtime/actions/runs/17377924957/job/49328417065

I am not familiar with gcc/clang. Seems gcc and clang is ok when use c99. Only msvc must use c11.

#endif

/* There is no need to check the WASI layout if we're using uvwasi or libc-wasi
Expand Down
Loading