HomePhabricator

Use preprocessor macros instead of autoconf to detect endianness

Description

Use preprocessor macros instead of autoconf to detect endianness

Summary:
This does not fix any particular issue but it's preferable to not
rely on autoconf. This avoids endianness mess for users on BE hosts
if they use their build without autoconf.

The macros are carefully written to err on the side of the caution,
e.g., we #error if the user manually configures a different endianness
than what we detect.

This is a backport of secp256k1 PR787

Test Plan:

ninja check-secp256k1

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D7600

Details

Provenance
Tim Ruffing <crypto@timruffing.de>Authored on Jul 21 2020, 12:05
deadalnixCommitted on Sep 27 2020, 23:22
deadalnixPushed on Sep 27 2020, 23:22
Reviewer
Restricted Project
Differential Revision
D7600: Use preprocessor macros instead of autoconf to detect endianness
Parents
rABCa6ab73d408e2: secp256k1_gej_double_nonzero supports infinity
Branches
Unknown
Tags
Unknown