random: Rearrange random.h

I think ifdef is easier to read than ifndef.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2014-09-13 09:47:59 -04:00
parent 97c6c836d3
commit 86b15743a1
1 changed files with 6 additions and 6 deletions

View File

@ -4,17 +4,17 @@
#ifndef OCARINA_CORE_RANDOM_H
#define OCARINA_CORE_RANDOM_H
#ifndef CONFIG_TEST
#ifdef CONFIG_TEST
void _seed_random(unsigned int);
unsigned int _pick_random();
#else /* CONFIG_TEST */
#include <stdlib.h>
static inline void _seed_random(unsigned int n) { srand(time(NULL) + n); }
static inline unsigned int _pick_random() { return rand(); }
#else /* CONFIG_TEST */
void _seed_random(unsigned int);
unsigned int _pick_random();
#endif /* CONFIG_TEST */