-
Notifications
You must be signed in to change notification settings - Fork 824
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
Don't #include inside extern "C" blocks. #2108
Conversation
Also free the malloc'd error string in print_wasmer_error(). Run the C code through clang-format.
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.
Looks good -- thanks!
c_statements.push(CStatement::LiteralConstant { | ||
value: "\n#ifdef __cplusplus\n}\n#endif\n\n".to_string(), | ||
}); |
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 don't remember much about the abstractions here but it might be nice to have the CPlusPlus guard be a thing that can work on nested data / trees so we don't have to remember to close it ourselves.
Don't let that block this PR though
int error_len = wasmer_last_error_length(); | ||
printf("Error len: `%d`\n", error_len); | ||
char* error_str = (char*) malloc(error_len); | ||
char *error_str = (char *)malloc(error_len); |
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 will never believe that char *name
is more readable or accurate than char* name
😆
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.
char x, *y, f()
is a char, a pointer-to-char and a function that returns a char. What a language! 😆
bors r+ |
2108: Don't #include inside extern "C" blocks. r=nlewycky a=nlewycky Also free the malloc'd error string in print_wasmer_error(). Run the C code through clang-format. Co-authored-by: Nick Lewycky <[email protected]> Co-authored-by: nlewycky <[email protected]>
Build failed: |
The header file generated by engine-object-file doesn't #include the wasm types it needs and relies on these being included before it.
bors r+ |
2108: Don't #include inside extern "C" blocks. r=nlewycky a=nlewycky Also free the malloc'd error string in print_wasmer_error(). Run the C code through clang-format. Co-authored-by: Nick Lewycky <[email protected]> Co-authored-by: nlewycky <[email protected]>
Build failed: |
bors r+ |
Also free the malloc'd error string in print_wasmer_error().
Run the C code through clang-format.