-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
errno.h constants regression (wasi types vs preprocessor) #9996
Comments
(In a pinch I can work around this by changing dav1d's code to avoid using the |
Closing this in favor of trying to fix at the dav1d side: https://code.videolan.org/videolan/dav1d/merge_requests/860 |
Might be worth raising this on in the WASI repo .. I'm also not how common/valid that pattern is. |
Ok, I'll go ahead and reopen this for further discussion -- is https://github.com/CraneStation/wasi-libc the right repo for that? |
Either there or maybe an issue on the main wasi repo, I'm not sure which is better, https://github.com/WebAssembly/WASI |
Yes https://github.com/CraneStation/wasi-libc is the right place. Lets fix locally at the same time as pushing for an upstream change. @Brion do you have time to whip up a local PR.. along with a simple test i guess? |
@sbc100 sure, I'll work on that shortly. Shouldn't be too hard to add a compilation test. |
Uses UINT16_C for backing of errno constants (EPERM etc) as in previous versions, rather than casting them to __wasm_errno_t. This fixes some portable codebases that use the C preprocessor to compare the constant values like this: ``` #if EPERM > 0 #define DAV1D_ERR(e) (-(e)) #else #define DAV1D_ERR(e) (e) #endif ``` Adds a test case to catch regressions. Fixes emscripten-core#9996
Uses UINT16_C for backing of errno constants (EPERM etc) as in previous versions, rather than casting them to __wasm_errno_t. This fixes some portable codebases that use the C preprocessor to compare the constant values like this: ``` #if EPERM > 0 #define DAV1D_ERR(e) (-(e)) #else #define DAV1D_ERR(e) (e) #endif ``` Adds a test case to catch regressions. Fixes emscripten-core#9996
Uses UINT16_C for backing of errno constants (EPERM etc) as in previous versions, rather than casting them to __wasm_errno_t. This fixes some portable codebases that use the C preprocessor to compare the constant values like this: ``` #if EPERM > 0 #define DAV1D_ERR(e) (-(e)) #else #define DAV1D_ERR(e) (e) #endif ``` Adds a test case to catch regressions. Fixes emscripten-core#9996
Uses UINT16_C for backing of errno constants (EPERM etc) as in previous versions, rather than casting them to __wasm_errno_t. This fixes some portable codebases that use the C preprocessor to compare the constant values like this: ``` #if EPERM > 0 #define DAV1D_ERR(e) (-(e)) #else #define DAV1D_ERR(e) (e) #endif ``` Adds a test case to catch regressions. Fixes #9996
…e#10025) Uses UINT16_C for backing of errno constants (EPERM etc) as in previous versions, rather than casting them to __wasm_errno_t. This fixes some portable codebases that use the C preprocessor to compare the constant values like this: ``` #if EPERM > 0 #define DAV1D_ERR(e) (-(e)) #else #define DAV1D_ERR(e) (e) #endif ``` Adds a test case to catch regressions. Fixes emscripten-core#9996
As of cffcd70 the definitions of
EPERM
etc inerrno.h
changed from untyped integers to typed references to wasi constants, such as:This breaks preprocessor code like this in the dav1d AV1 decoder:
Test case:
Output:
The text was updated successfully, but these errors were encountered: