-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move WASM const definitions to a source file
Currently we are defining the WASM integer size and alignments in the `stdio.h` header file, this is wrong because this file is included in the build by way of `build.rs` as well as by upstream `libsecp256k1`. Move WASM integer definitions to a `C` source file and build the file into the binary if target is WASM.
- Loading branch information
Showing
6 changed files
with
20 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <stddef.h> | ||
#define alignof(type) offsetof (struct { char c; type member; }, member) | ||
|
||
const unsigned char WASM32_INT_SIZE = sizeof(int); | ||
const unsigned char WASM32_INT_ALIGN = alignof(int); | ||
|
||
const unsigned char WASM32_UNSIGNED_INT_SIZE = sizeof(unsigned int); | ||
const unsigned char WASM32_UNSIGNED_INT_ALIGN = alignof(unsigned int); | ||
|
||
const unsigned char WASM32_SIZE_T_SIZE = sizeof(size_t); | ||
const unsigned char WASM32_SIZE_T_ALIGN = alignof(size_t); | ||
|
||
const unsigned char WASM32_UNSIGNED_CHAR_SIZE = sizeof(unsigned char); | ||
const unsigned char WASM32_UNSIGNED_CHAR_ALIGN = alignof(unsigned char); | ||
|
||
const unsigned char WASM32_PTR_SIZE = sizeof(void*); | ||
const unsigned char WASM32_PTR_ALIGN = alignof(void*); |