1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

Simplify quirks for C++Builder

This commit is contained in:
Frank Denis 2016-03-18 22:13:23 +01:00
parent a456244a95
commit 05d82ad147
3 changed files with 6 additions and 15 deletions

View File

@ -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__

View File

@ -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;
}

View File

@ -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)