int128: Tidy #includes of int128.h and int128_impl.h

After this commit, int128.h and int128_impl.h are included as follows:
 - .c files which use int128 include int128_impl.h (after util.h)
 - .h files which use int128 include int128.h (after util.h)

This list is exhaustive. util.h needs to included first because it sets
up necessary #defines.
This commit is contained in:
Tim Ruffing
2022-02-01 14:43:16 +01:00
committed by Russell O'Connor
parent 2914bccbc0
commit dceaa1f579
8 changed files with 31 additions and 23 deletions

View File

@@ -1,19 +1,16 @@
#ifndef SECP256K1_INT128_H
#define SECP256K1_INT128_H
#if defined HAVE_CONFIG_H
#include "libsecp256k1-config.h"
#endif
#include "util.h"
#if defined(SECP256K1_INT128_NATIVE)
#include "int128_native.h"
#elif defined(SECP256K1_INT128_STRUCT)
#include "int128_struct.h"
#else
#error "Please select int128 implementation"
#endif
#if defined(SECP256K1_WIDEMUL_INT128)
# if defined(SECP256K1_INT128_NATIVE)
# include "int128_native.h"
# elif defined(SECP256K1_INT128_STRUCT)
# include "int128_struct.h"
# else
# error "Please select int128 implementation"
# endif
/* Multiply two unsigned 64-bit values a and b and write the result to r. */
static SECP256K1_INLINE void secp256k1_u128_mul(secp256k1_uint128 *r, uint64_t a, uint64_t b);
@@ -78,3 +75,5 @@ static SECP256K1_INLINE int secp256k1_i128_eq_var(const secp256k1_int128 *a, con
static SECP256K1_INLINE int secp256k1_i128_check_pow2(const secp256k1_int128 *r, unsigned int n);
#endif
#endif