void (*generate)(void *state, uint8_t *output, uint32_t idx); | void (*generate)(void *state, uint8_t *output, uint32_t idx); | ||||
}; | }; | ||||
/** | |||||
* Evaluate the condition 'x', while hinting to the compiler that it is | |||||
* likely to be false. | |||||
*/ | |||||
#ifdef __GNUC__ | |||||
#define UNLIKELY(x) __builtin_expect((x), 0) | |||||
#else | |||||
#define UNLIKELY(x) (x) | |||||
#endif | |||||
#ifdef OTTERY_INTERNAL | #ifdef OTTERY_INTERNAL | ||||
struct ottery_config { | struct ottery_config { | ||||
/** The PRF that we should use. If NULL, we use the default. */ | /** The PRF that we should use. If NULL, we use the default. */ |
#define OTTERY_NO_PID_CHECK | #define OTTERY_NO_PID_CHECK | ||||
#endif | #endif | ||||
/** | |||||
* Evaluate the condition 'x', while hinting to the compiler that it is | |||||
* likely to be false. | |||||
*/ | |||||
#define UNLIKELY(x) __builtin_expect((x), 0) | |||||
/** Magic number for deciding whether an ottery_state is initialized. */ | /** Magic number for deciding whether an ottery_state is initialized. */ | ||||
#define MAGIC_BASIS 0x11b07734 | #define MAGIC_BASIS 0x11b07734 | ||||
#include "ottery.h" | #include "ottery.h" | ||||
#include "ottery_st.h" | #include "ottery_st.h" | ||||
/** | |||||
* Evaluate the condition 'x', while hinting to the compiler that it is | |||||
* likely to be false. | |||||
*/ | |||||
#ifdef __GNUC__ | |||||
#define UNLIKELY(x) __builtin_expect((x), 0) | |||||
#else | |||||
#define UNLIKELY(x) (x) | |||||
#endif | |||||
/** Flag: true iff ottery_global_state_ is initialized. */ | /** Flag: true iff ottery_global_state_ is initialized. */ | ||||
static int ottery_global_state_initialized_ = 0; | static int ottery_global_state_initialized_ = 0; |