Vector Optimized Library of Kernels 2.5.2
Architecture-tuned implementations of math kernels
 
Loading...
Searching...
No Matches
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>
19typedef ptrdiff_t ssize_t;
20
22// rint functions
24#if _MSC_VER < 1800
25#include <math.h>
26static inline long lrint(double x) { return (long)(x > 0.0 ? x + 0.5 : x - 0.5); }
27static inline long lrintf(float x) { return (long)(x > 0.0f ? x + 0.5f : x - 0.5f); }
28static inline long long llrint(double x)
29{
30 return (long long)(x > 0.0 ? x + 0.5 : x - 0.5);
31}
32static inline long long llrintf(float x)
33{
34 return (long long)(x > 0.0f ? x + 0.5f : x - 0.5f);
35}
36static inline double rint(double x) { return (x > 0.0) ? floor(x + 0.5) : ceil(x - 0.5); }
37static inline float rintf(float x)
38{
39 return (x > 0.0f) ? floorf(x + 0.5f) : ceilf(x - 0.5f);
40}
41#endif
42
44// math constants
46#if _MSC_VER < 1800
47#include <math.h>
48#define INFINITY HUGE_VAL
49#endif
50
52// random and srandom
54#include <stdlib.h>
55static inline long int random(void) { return rand(); }
56static inline void srandom(unsigned int seed) { srand(seed); }
57
58#endif // _MSC_CONFIG_H_ ]
static float rintf(float x)
Definition: config.h:37
static double rint(double x)
Definition: config.h:36
static long int random(void)
Definition: config.h:55
static long lrintf(float x)
Definition: config.h:27
static long long llrint(double x)
Definition: config.h:28
ptrdiff_t ssize_t
Definition: config.h:19
static void srandom(unsigned int seed)
Definition: config.h:56
static long long llrintf(float x)
Definition: config.h:32
static long lrint(double x)
Definition: config.h:26