containers / libocispec

a C library for accessing OCI runtime and image spec files
Other
52 stars 30 forks source link

add redefine for stdin stdout stderr when using musl #121

Closed DawningRain closed 2 years ago

DawningRain commented 2 years ago

When using musl libc, stdin/stdout/stderr defines to (stdin)/(stdout)/(stderr). So the json-schema contains stdin/stdout/stderr generating code compiles failed.

ERROR message

error: expected identifier before ‘(’ token
   94 |             ret->stdin = strdup (str ? str : "");
      |                  ^~~~~

95:22: error: expected identifier before ‘(’ token
   95 |             if (ret->stdin == NULL)

Add redefine for stdin stdout stderr when using musl to resovle such json-schema

"stdin": {
    "type": "string"
},
"stdout": {
    "type": "string"
},
"stderr": {
    "type": "string"
}
DawningRain commented 2 years ago

@giuseppe please review this pr.

flouthoc commented 2 years ago

@giuseppe PTAL