Skip to content

Commit e05da9e

Browse files
committed
Fix c++ build
1 parent c45386d commit e05da9e

6 files changed

+20
-0
lines changed

src/precompute_ecmult.c

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ int main(void) {
7575
fprintf(fp, "#include \"../include/secp256k1.h\"\n");
7676
fprintf(fp, "#include \"group.h\"\n");
7777
fprintf(fp, "#include \"ecmult.h\"\n");
78+
fprintf(fp, "#include \"precomputed_ecmult.h\"\n");
7879
fprintf(fp, "#define S(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) SECP256K1_GE_STORAGE_CONST(0x##a##u,0x##b##u,0x##c##u,0x##d##u,0x##e##u,0x##f##u,0x##g##u,0x##h##u,0x##i##u,0x##j##u,0x##k##u,0x##l##u,0x##m##u,0x##n##u,0x##o##u,0x##p##u)\n");
7980
fprintf(fp, "#if ECMULT_TABLE_SIZE(ECMULT_WINDOW_SIZE) > %ld\n", ECMULT_TABLE_SIZE(ECMULT_WINDOW_SIZE));
8081
fprintf(fp, " #error configuration mismatch, invalid ECMULT_WINDOW_SIZE. Try deleting precomputed_ecmult.c before the build.\n");

src/precompute_ecmult_gen.c

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ int main(int argc, char **argv) {
3636
fprintf(fp, "#include \"../include/secp256k1.h\"\n");
3737
fprintf(fp, "#include \"group.h\"\n");
3838
fprintf(fp, "#include \"ecmult_gen.h\"\n");
39+
fprintf(fp, "#include \"precomputed_ecmult_gen.h\"\n");
3940
fprintf(fp, "#ifdef EXHAUSTIVE_TEST_ORDER\n");
4041
fprintf(fp, "# error Cannot compile precomputed_ecmult_gen.c in exhaustive test mode\n");
4142
fprintf(fp, "#endif /* EXHAUSTIVE_TEST_ORDER */\n");

src/precomputed_ecmult.c

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/precomputed_ecmult.h

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#ifndef SECP256K1_PRECOMPUTED_ECMULT_H
88
#define SECP256K1_PRECOMPUTED_ECMULT_H
99

10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
1014
#include "group.h"
1115
#if defined(EXHAUSTIVE_TEST_ORDER)
1216
#if EXHAUSTIVE_TEST_ORDER == 13
@@ -24,4 +28,8 @@ extern const secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)];
2428
extern const secp256k1_ge_storage secp256k1_pre_g_128[ECMULT_TABLE_SIZE(WINDOW_G)];
2529
#endif /* defined(EXHAUSTIVE_TEST_ORDER) */
2630

31+
#ifdef __cplusplus
32+
}
33+
#endif
34+
2735
#endif /* SECP256K1_PRECOMPUTED_ECMULT_H */

src/precomputed_ecmult_gen.c

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/precomputed_ecmult_gen.h

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#ifndef SECP256K1_PRECOMPUTED_ECMULT_GEN_H
88
#define SECP256K1_PRECOMPUTED_ECMULT_GEN_H
99

10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
1014
#include "group.h"
1115
#include "ecmult_gen.h"
1216
#ifdef EXHAUSTIVE_TEST_ORDER
@@ -15,4 +19,8 @@ static secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N(EC
1519
extern const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N(ECMULT_GEN_PREC_BITS)][ECMULT_GEN_PREC_G(ECMULT_GEN_PREC_BITS)];
1620
#endif /* defined(EXHAUSTIVE_TEST_ORDER) */
1721

22+
#ifdef __cplusplus
23+
}
24+
#endif
25+
1826
#endif /* SECP256K1_PRECOMPUTED_ECMULT_GEN_H */

0 commit comments

Comments
 (0)