diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-17 18:58:31 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-17 18:58:31 +0100 |
commit | 278502d4c4fd89b7cc864d437bc985a664579717 (patch) | |
tree | 261e4ba15355d643bbb92c330d0dc3e4d7096100 /src | |
parent | contrib: add embeddable wireguard library (diff) | |
download | wireguard-monolithic-historical-278502d4c4fd89b7cc864d437bc985a664579717.tar.xz wireguard-monolithic-historical-278502d4c4fd89b7cc864d437bc985a664579717.zip |
tools: do not collide types with libc clashes
Diffstat (limited to '')
-rw-r--r-- | src/tools/curve25519.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/tools/curve25519.c b/src/tools/curve25519.c index 664cd80..2195040 100644 --- a/src/tools/curve25519.c +++ b/src/tools/curve25519.c @@ -8,12 +8,18 @@ #include <stdint.h> #include <string.h> -typedef uint64_t u64; -typedef uint32_t u32; +#ifdef __linux__ +#include <linux/types.h> +typedef __u64 u64; +typedef __u32 u32; +typedef __u8 u8; +typedef __s64 s64; +#else +typedef uint64_t u64, __le64; +typedef uint32_t u32, __le32; typedef uint8_t u8; typedef int64_t s64; -typedef u64 __le64; -typedef u32 __le32; +#endif #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #define le64_to_cpup(a) __builtin_bswap64(*(a)) #define le32_to_cpup(a) __builtin_bswap32(*(a)) |