Skip to content

Commit 185a6af

Browse files
Merge #925: changed include statements without prefix 'include/'
3c90bdd change local lib headers to be relative for those pointing at "include/" dir (William Bright) Pull request description: Referencing #924 , this PR splits the two issues brought on to a smaller to digest change. What this does is removes the prefix "include/" when referencing the local library header files. e.g: from: ```cpp #include "include/secp256k1.h" ``` to: ```cpp #include "secp256k1.h" ``` Rationale besides styling and consistency across other files in the repo, it makes it easier for outside builds to properly locate the headers. A live example seen here when attempting to build this library within bitcoin repo: ```sh [ 14%] Building CXX object leveldb/CMakeFiles/leveldb.dir/util/bloom.cc.o /tmp/bitcoin/src/secp256k1/src/secp256k1.c:7:10: fatal error: include/secp256k1.h: No such file or directory 7 | #include "include/secp256k1.h" | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [secp256k1/CMakeFiles/Secp256k1.dir/build.make:76: secp256k1/CMakeFiles/Secp256k1.dir/src/secp256k1.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:537: secp256k1/CMakeFiles/Secp256k1.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... ``` ACKs for top commit: gmaxwell: ACK 3c90bdd real-or-random: ACK 3c90bdd code looks good and even the tests compile fine now without `-I` args Tree-SHA512: 94d212718c6f4901f1c310aff504b7afedda91268143ffe1b45e9883cd517c0599e40ac798a51b54d66cd31646fe8cb1a489f1776612cfb5963654f4a1cee757
2 parents d0bd269 + 3c90bdd commit 185a6af

25 files changed

+40
-39
lines changed

contrib/lax_der_parsing.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
***********************************************************************/
66

77
#include <string.h>
8-
#include <secp256k1.h>
98

109
#include "lax_der_parsing.h"
1110

contrib/lax_der_parsing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
#ifndef SECP256K1_CONTRIB_LAX_DER_PARSING_H
5252
#define SECP256K1_CONTRIB_LAX_DER_PARSING_H
5353

54+
#ifndef SECP256K1_H
5455
#include <secp256k1.h>
56+
#endif
5557

5658
#ifdef __cplusplus
5759
extern "C" {

contrib/lax_der_privatekey_parsing.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
***********************************************************************/
66

77
#include <string.h>
8-
#include <secp256k1.h>
98

109
#include "lax_der_privatekey_parsing.h"
1110

contrib/lax_der_privatekey_parsing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
#ifndef SECP256K1_CONTRIB_BER_PRIVATEKEY_H
2929
#define SECP256K1_CONTRIB_BER_PRIVATEKEY_H
3030

31+
#ifndef SECP256K1_H
3132
#include <secp256k1.h>
33+
#endif
3234

3335
#ifdef __cplusplus
3436
extern "C" {

src/bench_ecdh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
#include <string.h>
88

9-
#include "include/secp256k1.h"
10-
#include "include/secp256k1_ecdh.h"
9+
#include "../include/secp256k1.h"
10+
#include "../include/secp256k1_ecdh.h"
1111
#include "util.h"
1212
#include "bench.h"
1313

src/bench_ecmult.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <stdio.h>
77

88
#include "secp256k1.c"
9+
#include "../include/secp256k1.h"
910

10-
#include "include/secp256k1.h"
1111
#include "util.h"
1212
#include "hash_impl.h"
1313
#include "field_impl.h"

src/bench_internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <stdio.h>
77

88
#include "secp256k1.c"
9+
#include "../include/secp256k1.h"
910

10-
#include "include/secp256k1.h"
1111
#include "assumptions.h"
1212
#include "util.h"
1313
#include "hash_impl.h"

src/bench_recover.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
55
***********************************************************************/
66

7-
#include "include/secp256k1.h"
8-
#include "include/secp256k1_recovery.h"
7+
#include "../include/secp256k1.h"
8+
#include "../include/secp256k1_recovery.h"
99
#include "util.h"
1010
#include "bench.h"
1111

src/bench_schnorrsig.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include <stdlib.h>
99

1010

11-
#include "include/secp256k1.h"
12-
#include "include/secp256k1_schnorrsig.h"
11+
#include "../include/secp256k1.h"
12+
#include "../include/secp256k1_schnorrsig.h"
1313
#include "util.h"
1414
#include "bench.h"
1515

src/bench_sign.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
55
***********************************************************************/
66

7-
#include "include/secp256k1.h"
7+
#include "../include/secp256k1.h"
88
#include "util.h"
99
#include "bench.h"
1010

0 commit comments

Comments
 (0)