mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-23 20:15:19 -07:00
Simplify quirks for C++Builder
This commit is contained in:
parent
a456244a95
commit
05d82ad147
@ -17,9 +17,8 @@
|
||||
# include "randombytes_nativeclient.h"
|
||||
#endif
|
||||
|
||||
#if defined(random)
|
||||
/* C++Builder defines a "random" macro */
|
||||
#undef random
|
||||
#endif
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#ifdef __native_client__
|
||||
|
@ -36,6 +36,10 @@ extern "C"
|
||||
# endif
|
||||
BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength);
|
||||
# pragma comment(lib, "advapi32.lib")
|
||||
# ifdef __BORLANDC__
|
||||
# define _ftime ftime
|
||||
# define _timeb timeb
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define SALSA20_RANDOM_BLOCK_SIZE crypto_core_salsa20_OUTPUTBYTES
|
||||
@ -77,21 +81,10 @@ sodium_hrtime(void)
|
||||
|
||||
#ifdef _WIN32
|
||||
{
|
||||
#ifdef __BORLANDC__
|
||||
struct timeb tb;
|
||||
#else
|
||||
struct _timeb tb;
|
||||
#endif
|
||||
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4996)
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
ftime(&tb);
|
||||
#else
|
||||
_ftime(&tb);
|
||||
#endif
|
||||
|
||||
# pragma warning(pop)
|
||||
ts = ((uint64_t) tb.time) * 1000000U + ((uint64_t) tb.millitm) * 1000U;
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(random)
|
||||
/* C++Builder defines a "random" macro */
|
||||
#undef random
|
||||
#endif
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
# define strcmp(s1, s2) xstrcmp(s1, s2)
|
||||
|
Loading…
Reference in New Issue
Block a user