Vector Optimized Library of Kernels  2.0
Architecture-tuned implementations of math kernels
config.h
Go to the documentation of this file.
1 #ifndef _MSC_VER // [
2 #error "Use this header only with Microsoft Visual C++ compilers!"
3 #endif // _MSC_VER ]
4 
5 #ifndef _MSC_CONFIG_H_ // [
6 #define _MSC_CONFIG_H_
7 
9 // enable inline functions for C code
11 #ifndef __cplusplus
12 # define inline __inline
13 #endif
14 
16 // signed size_t
18 #include <stddef.h>
19 typedef ptrdiff_t ssize_t;
20 
22 // rint functions
24 #if _MSC_VER < 1800
25 #include <math.h>
26 static inline long lrint(double x){return (long)(x > 0.0 ? x + 0.5 : x - 0.5);}
27 static inline long lrintf(float x){return (long)(x > 0.0f ? x + 0.5f : x - 0.5f);}
28 static inline long long llrint(double x){return (long long)(x > 0.0 ? x + 0.5 : x - 0.5);}
29 static inline long long llrintf(float x){return (long long)(x > 0.0f ? x + 0.5f : x - 0.5f);}
30 static inline double rint(double x){return (x > 0.0)? floor(x + 0.5) : ceil(x - 0.5);}
31 static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : ceilf(x - 0.5f);}
32 #endif
33 
35 // math constants
37 #if _MSC_VER < 1800
38 #include <math.h>
39 #define INFINITY HUGE_VAL
40 #endif
41 
43 // random and srandom
45 #include <stdlib.h>
46 static inline long int random (void) { return rand(); }
47 static inline void srandom (unsigned int seed) { srand(seed); }
48 
49 #endif // _MSC_CONFIG_H_ ]
static long lrint(double x)
Definition: config.h:26
static long lrintf(float x)
Definition: config.h:27
static long int random(void)
Definition: config.h:46
static long long llrintf(float x)
Definition: config.h:29
static float rintf(float x)
Definition: config.h:31
static double rint(double x)
Definition: config.h:30
static void srandom(unsigned int seed)
Definition: config.h:47
ptrdiff_t ssize_t
Definition: config.h:19
static long long llrint(double x)
Definition: config.h:28