From 8ef997c636c8dee8f408909b526405f417ececb0 Mon Sep 17 00:00:00 2001 From: Jack Hadrill Date: Mon, 31 Jan 2022 22:08:55 +0000 Subject: [PATCH] Add support for MacOS --- Romulus-M/encrypt_wrapper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Romulus-M/encrypt_wrapper.c b/Romulus-M/encrypt_wrapper.c index faaac86..7b4f1da 100644 --- a/Romulus-M/encrypt_wrapper.c +++ b/Romulus-M/encrypt_wrapper.c @@ -5,6 +5,11 @@ #ifdef _MSC_VER #define __bswap_16 _byteswap_ushort #define __bswap_32 _byteswap_ulong +#elif defined(__APPLE__) +#include +#define __bswap_16 OSSwapInt16 +#define __bswap_32 OSSwapInt32 +#define __bswap_64 OSSwapInt64 #else #include #endif @@ -161,4 +166,4 @@ void fill_random(unsigned char* buffer, int length){ secRandom = rand(&rCtx); memcpy(&buffer[i], &secRandom, MIN(sizeof(UINT32), length-i)); } -} \ No newline at end of file +}