Skip to content
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

Portability workaround for wasi/api.h errno constants #10025

Merged
merged 1 commit into from
Dec 13, 2019

Conversation

bvibber
Copy link
Collaborator

@bvibber bvibber commented Dec 12, 2019

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

@bvibber bvibber requested a review from sbc100 December 12, 2019 23:05
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
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@kripken
Copy link
Member

kripken commented Jan 14, 2020

@juj does this address the issue you were seeing?

@juj
Copy link
Collaborator

juj commented Jan 14, 2020

Oh perfect, thanks! Missed this one go by..

belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants