Merge pull request 'Add support for MacOS' (#1) from feature/macOS into chat_struct_crypto

Reviewed-on: #1
This commit is contained in:
Simon 2022-01-31 22:18:16 +00:00
commit 56b645db47
1 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,11 @@
#ifdef _MSC_VER
#define __bswap_16 _byteswap_ushort
#define __bswap_32 _byteswap_ulong
#elif __APPLE__
#include <libkern/OSByteOrder.h>
#define __bswap_16 OSSwapInt16
#define __bswap_32 OSSwapInt32
#define __bswap_64 OSSwapInt64
#else
#include <byteswap.h>
#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));
}
}
}