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

What does SECP256K1_API do? #680

Open
tcharding opened this issue Feb 4, 2024 · 1 comment
Open

What does SECP256K1_API do? #680

tcharding opened this issue Feb 4, 2024 · 1 comment

Comments

@tcharding
Copy link
Member

Removing the define of this variable in build.rs doesn't seem to do anything. What does this var do?

Context

    // Actual build
    let mut base_config = cc::Build::new();
    base_config.include("depend/secp256k1/")
               .include("depend/secp256k1/include")
               .include("depend/secp256k1/src")
               .flag_if_supported("-Wno-unused-function") // some ecmult stuff is defined but not used upstream
               .flag_if_supported("-Wno-unused-parameter") // patching out printf causes this warning
               .define("SECP256K1_API", Some(""))
               .define("ENABLE_MODULE_ECDH", Some("1"))
               .define("ENABLE_MODULE_SCHNORRSIG", Some("1"))
               .define("ENABLE_MODULE_EXTRAKEYS", Some("1"))
               .define("ENABLE_MODULE_ELLSWIFT", Some("1"))
@apoelstra
Copy link
Member

I'm surprised that the code compiles without that define. It erases the SECP256K1_API markers that appear in the libsecp header files, and which is used by the upstream build process to distinguish between exported and non-exported symbols.

I guess we could drop it since it only occurs in the header files, and we don't compile those..

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

No branches or pull requests

2 participants