Skip to content

Conversation

vkensou
Copy link

@vkensou vkensou commented Aug 29, 2025

No description provided.

@@ -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.

@lum1n0us lum1n0us added the bug-fix Determine if this PR addresses a bug. It will be used by scripts to classify PRs. label Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix Determine if this PR addresses a bug. It will be used by scripts to classify PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants