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:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user