diff --git a/CMakeLists.txt b/CMakeLists.txt index 23bfdcdb..5eb00b90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,13 @@ set(core_sources core/Lossless_UDP.c core/net_crypto.c core/Messenger.c) - -set(test_sources - testing/nTox.c) +if(WIN32) + set(test_sources + testing/Messenger_test.c) +else() + set(test_sources + testing/nTox.c) +endif() add_executable(${exe_name} ${core_sources} diff --git a/core/network.c b/core/network.c index 9693df1c..c08b3512 100644 --- a/core/network.c +++ b/core/network.c @@ -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() { - #ifdef WIN32 + #ifndef VANILLA_NACL //NOTE: this function comes from libsodium return randombytes_random(); #else diff --git a/core/network.h b/core/network.h index 4fa30905..33f11239 100644 --- a/core/network.h +++ b/core/network.h @@ -97,6 +97,7 @@ typedef struct 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(); //Basic network functions: