Skip to content
Snippets Groups Projects
Commit e4000ad6 authored by cheloveck3-0's avatar cheloveck3-0 Committed by Kurotych Anatolii
Browse files

added header to macos for endian.h (#37)

Added header to macOS for endian.h
parent 7716e11a
No related branches found
No related tags found
No related merge requests found
#ifndef MACOS_SPECIFIC_ENDIAN_H
#define MACOS_SPECIFIC_ENDIAN_H
/** compatibility header for endian.h
* This is a simple compatibility shim to convert
* BSD/Linux endian macros to the Mac OS X equivalents.
* It is public domain.
* */
#ifndef __APPLE__
#warning "This header file (endian.h) is MacOS X specific.\n"
#endif /* __APPLE__ */
#include <machine/endian.h>
#include <libkern/OSByteOrder.h>
#define htobe16(x) OSSwapHostToBigInt16(x)
#define htole16(x) OSSwapHostToLittleInt16(x)
#define be16toh(x) OSSwapBigToHostInt16(x)
#define le16toh(x) OSSwapLittleToHostInt16(x)
#define htobe32(x) OSSwapHostToBigInt32(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#define be32toh(x) OSSwapBigToHostInt32(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define htobe64(x) OSSwapHostToBigInt64(x)
#define htole64(x) OSSwapHostToLittleInt64(x)
#define be64toh(x) OSSwapBigToHostInt64(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)
#endif // MACOS_SPECIFIC_ENDIAN_H
......@@ -20,6 +20,8 @@
#if defined (__WIN32)
#include <Windows.h>
#include <bcrypt.h>
#elif defined (__APPLE__)
#include "macos_specific_endian.h"
#else
#include <endian.h>
#endif
......
......@@ -3,8 +3,9 @@ HEADERS += $$PWD/hash.h \
$$PWD/picnic.h \
$$PWD/picnic_impl.h \
$$PWD/picnic_types.h \
$$PWD/platform.h \
$$PWD/platform.h
macos { HEADERS += $$PWD/macos_specific_endian.h }
SOURCES += $$PWD/hash.c \
$$PWD/lowmc_constants.c \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment