From 11a39bb49a1b23aa09379dab21f34975b674fac2 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 13 Jul 2013 19:24:14 -0400 Subject: Cmake changed, small change in random_int() Cmake builds now builds the new ncurses test only on non windows. --- CMakeLists.txt | 10 +++++++--- core/network.c | 4 +++- core/network.h | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) 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: -- cgit v1.2.3