summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-13 19:24:14 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-13 19:24:14 -0400
commit11a39bb49a1b23aa09379dab21f34975b674fac2 (patch)
tree5cac15b76caeb6fa5b71dffdca42ef280338c324
parent5b3c4442ddb0473d5eb1ee9386d2658a27b68af4 (diff)
Cmake changed, small change in random_int()
Cmake builds now builds the new ncurses test only on non windows.
-rw-r--r--CMakeLists.txt10
-rw-r--r--core/network.c4
-rw-r--r--core/network.h1
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
9 core/Lossless_UDP.c 9 core/Lossless_UDP.c
10 core/net_crypto.c 10 core/net_crypto.c
11 core/Messenger.c) 11 core/Messenger.c)
12 12if(WIN32)
13set(test_sources 13 set(test_sources
14 testing/nTox.c) 14 testing/Messenger_test.c)
15else()
16 set(test_sources
17 testing/nTox.c)
18endif()
15 19
16add_executable(${exe_name} 20add_executable(${exe_name}
17 ${core_sources} 21 ${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()
48 48
49} 49}
50 50
51//return a random number
52//NOTE: this function should probably not be used where cryptographic randomness is absolutely necessary
51uint32_t random_int() 53uint32_t random_int()
52{ 54{
53 #ifdef WIN32 55 #ifndef VANILLA_NACL
54 //NOTE: this function comes from libsodium 56 //NOTE: this function comes from libsodium
55 return randombytes_random(); 57 return randombytes_random();
56 #else 58 #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
97uint64_t current_time(); 97uint64_t current_time();
98 98
99//return a random number 99//return a random number
100//NOTE: this function should probably not be used where cryptographic randomness is absolutely necessary
100uint32_t random_int(); 101uint32_t random_int();
101 102
102//Basic network functions: 103//Basic network functions: