-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Define emscripten exception struct in native code. NFC #14431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c953563 to
365d6a3
Compare
365d6a3 to
b1627b4
Compare
6b1d670 to
554a344
Compare
b1627b4 to
9cbe3c4
Compare
554a344 to
f74ed6b
Compare
88d83d0 to
0cf5292
Compare
| return expected; | ||
| uintptr_t expected = (uintptr_t)t; | ||
| __c11_atomic_compare_exchange_strong((_Atomic uintptr_t*)p, &expected, (uintptr_t)s, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); | ||
| return (void*)expected; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these atomic changes related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed so that the header is compatible with C++.. this is musl internal header and it normally nevers goes through the C++ compiler.
I could split struct_info_internal.json into two.. one for C headers and one for C++ headers.. but it seemed better/simpler to fix this header to avoid the C++ error.
| for line in lines: | ||
| arg = line[1:].strip() | ||
| if '::' in arg: | ||
| arg = arg.split('::', 1)[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this works... is the namespace used in the file, I guess, so it's optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just allows us to write C_STRUCTS.__cxa_exception in the JS library code instead of C_STRUCTS.__cxxabiv1::__cxa_exception.. as long as there are no collisions it works fine.
0cf5292 to
07fa9ce
Compare
This is really step 1 of moving more of this code to be native.
07fa9ce to
83630d5
Compare
This is really step 1 of moving more of this code to be
native.