supranational / blst

Multilingual BLS12-381 signature library
Apache License 2.0
458 stars 175 forks source link

Add field to blst_uniq to fix compiler error with msvc #157

Closed jtraglia closed 1 year ago

jtraglia commented 1 year ago

When compiling with MSVC on Windows, we get the following error:

blst\bindings\blst_aux.h(53): error C2016: C requires that a struct or union have at least one member

Currently, to solve this issue, we are patching this file before compilation. It would be nice to not do that.

Not sure if the comment and field name are to your liking. Feel free to suggest something else.

dot-asm commented 1 year ago

Thanks for the report! The original reason for having the empty struct was to appease Rust bindgen. Empty struct was shown to let user compile code that is bound to fail and letting MSVC do the same, as effectively suggested here, is suboptimal. I've just committed alternative, allegedly better solution:-)

jtraglia commented 1 year ago

Thanks! I agree, your solution looks better.