This builds an executable for ios.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4511 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-10-12 00:29:17 +00:00
parent 7169f4a6cb
commit 1c621a602f
4 changed files with 97 additions and 6 deletions

View File

@ -8,6 +8,13 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
extern BOOLEAN NTAPI SystemFunction036(PVOID Buffer, ULONG BufferLength);
#elif __APPLE__
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#include <CommonCrypto/CommonRandom.h>
#else
#include <sys/random.h>
#endif
#else
#include <sys/random.h>
#endif
@ -44,7 +51,9 @@ JSValue _crypt_gensalt(JSContext* context, JSValueConst this_val, int argc, JSVa
char buffer[16];
#if defined(_WIN32)
ssize_t bytes = SystemFunction036(buffer, sizeof(buffer)) ? sizeof(buffer) : 0;
#elif defined(__APPLE__)
#elif defined(__APPLE__) && TARGET_OS_IPHONE
ssize_t bytes = CCRandomGenerateBytes(buffer, sizeof(buffer)) == kCCSuccess ? sizeof(buffer) : 0;
#elif defined(__APPLE__) && !TARGET_OS_IPHONE
ssize_t bytes = 0;
if (getentropy(buffer, sizeof(buffer)) == 0)
{