mirror of
https://github.com/Legrandin/pycryptodome.git
synced 2025-11-01 06:01:34 +00:00
Add check for stdint.h
This commit is contained in:
parent
34c9823baa
commit
e85155ffd1
2 changed files with 22 additions and 3 deletions
|
|
@ -108,6 +108,18 @@ def test_compilation(program, extra_cc_options=None, extra_libraries=None,
|
|||
return result
|
||||
|
||||
|
||||
def has_stdint_h():
|
||||
source = """
|
||||
#include <stdint.h>
|
||||
int main(void) {
|
||||
uint32_t u;
|
||||
u = 0;
|
||||
return u + 2;
|
||||
}
|
||||
"""
|
||||
return test_compilation(source, msg="stdint.h header")
|
||||
|
||||
|
||||
def compiler_supports_uint128():
|
||||
source = """
|
||||
int main(void)
|
||||
|
|
@ -273,6 +285,9 @@ def set_compiler_options(package_root, extensions):
|
|||
clang = compiler_is_clang()
|
||||
gcc = compiler_is_gcc()
|
||||
|
||||
if has_stdint_h():
|
||||
extra_macros.append(("HAVE_STDINT_H", None))
|
||||
|
||||
# Endianess
|
||||
extra_macros.append(("PYCRYPTO_" + sys.byteorder.upper() + "_ENDIAN", None))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue