Cmake changed, small change in random_int()

Cmake builds now builds the new ncurses test only on non windows.
This commit is contained in:
irungentoo 2013-07-13 19:24:14 -04:00
parent 5b3c4442dd
commit 11a39bb49a
3 changed files with 11 additions and 4 deletions

View File

@ -9,9 +9,13 @@ set(core_sources
core/Lossless_UDP.c core/Lossless_UDP.c
core/net_crypto.c core/net_crypto.c
core/Messenger.c) core/Messenger.c)
if(WIN32)
set(test_sources set(test_sources
testing/Messenger_test.c)
else()
set(test_sources
testing/nTox.c) testing/nTox.c)
endif()
add_executable(${exe_name} add_executable(${exe_name}
${core_sources} ${core_sources}

View File

@ -48,9 +48,11 @@ uint64_t current_time()
} }
//return a random number
//NOTE: this function should probably not be used where cryptographic randomness is absolutely necessary
uint32_t random_int() uint32_t random_int()
{ {
#ifdef WIN32 #ifndef VANILLA_NACL
//NOTE: this function comes from libsodium //NOTE: this function comes from libsodium
return randombytes_random(); return randombytes_random();
#else #else

View File

@ -97,6 +97,7 @@ typedef struct
uint64_t current_time(); uint64_t current_time();
//return a random number //return a random number
//NOTE: this function should probably not be used where cryptographic randomness is absolutely necessary
uint32_t random_int(); uint32_t random_int();
//Basic network functions: //Basic network functions: