aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/oaes_lib.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-02-16 14:19:42 +0100
committerRiccardo Spagni <ric@spagni.net>2018-02-16 14:19:42 +0100
commitba22928d4bc6516e3b10785fefa6735fafdd62d5 (patch)
treedd481d126bb68e950459a2b82cb0ac99f0b4cacf /src/crypto/oaes_lib.c
parentMerge pull request #3175 (diff)
parentFixed #if instead of #ifdef (diff)
downloadmonero-ba22928d4bc6516e3b10785fefa6735fafdd62d5.tar.xz
Merge pull request #3180
1dfed567 Fixed #if instead of #ifdef (Matt Little) 7c442453 Support building cncrypto lib with msvc (Matt Little)
Diffstat (limited to 'src/crypto/oaes_lib.c')
-rw-r--r--src/crypto/oaes_lib.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/crypto/oaes_lib.c b/src/crypto/oaes_lib.c
index 0afec6212..9e31ebf46 100644
--- a/src/crypto/oaes_lib.c
+++ b/src/crypto/oaes_lib.c
@@ -53,6 +53,12 @@
#include <unistd.h>
#endif
+#ifdef _MSC_VER
+#define GETPID() _getpid()
+#else
+#define GETPID() getpid()
+#endif
+
#include "oaes_config.h"
#include "oaes_lib.h"
@@ -478,7 +484,7 @@ static void oaes_get_seed( char buf[RANDSIZ + 1] )
sprintf( buf, "%04d%02d%02d%02d%02d%02d%03d%p%d",
gmTimer->tm_year + 1900, gmTimer->tm_mon + 1, gmTimer->tm_mday,
gmTimer->tm_hour, gmTimer->tm_min, gmTimer->tm_sec, timer.millitm,
- _test + timer.millitm, getpid() );
+ _test + timer.millitm, GETPID() );
#else
struct timeval timer;
struct tm *gmTimer;
@@ -490,7 +496,7 @@ static void oaes_get_seed( char buf[RANDSIZ + 1] )
sprintf( buf, "%04d%02d%02d%02d%02d%02d%03d%p%d",
gmTimer->tm_year + 1900, gmTimer->tm_mon + 1, gmTimer->tm_mday,
gmTimer->tm_hour, gmTimer->tm_min, gmTimer->tm_sec, timer.tv_usec/1000,
- _test + timer.tv_usec/1000, getpid() );
+ _test + timer.tv_usec/1000, GETPID() );
#endif
if( _test )
@@ -510,7 +516,7 @@ static uint32_t oaes_get_seed(void)
_test = (char *) calloc( sizeof( char ), timer.millitm );
_ret = gmTimer->tm_year + 1900 + gmTimer->tm_mon + 1 + gmTimer->tm_mday +
gmTimer->tm_hour + gmTimer->tm_min + gmTimer->tm_sec + timer.millitm +
- (uintptr_t) ( _test + timer.millitm ) + getpid();
+ (uintptr_t) ( _test + timer.millitm ) + GETPID();
#else
struct timeval timer;
struct tm *gmTimer;
@@ -522,7 +528,7 @@ static uint32_t oaes_get_seed(void)
_test = (char *) calloc( sizeof( char ), timer.tv_usec/1000 );
_ret = gmTimer->tm_year + 1900 + gmTimer->tm_mon + 1 + gmTimer->tm_mday +
gmTimer->tm_hour + gmTimer->tm_min + gmTimer->tm_sec + timer.tv_usec/1000 +
- (uintptr_t) ( _test + timer.tv_usec/1000 ) + getpid();
+ (uintptr_t) ( _test + timer.tv_usec/1000 ) + GETPID();
#endif
if( _test )