gwion-util
utilities for the Gwion project
Loading...
Searching...
No Matches
gwcommon.h
Go to the documentation of this file.
1
4#include <stddef.h>
5#include <stdlib.h>
6#include <inttypes.h>
7#include <float.h>
8#define GWION_EPSILON FLT_EPSILON
9/* common typedefs */
10typedef intptr_t m_int;
11typedef uintptr_t m_uint;
12typedef unsigned char m_bit;
13typedef float m_float;
14typedef char * m_str;
15typedef struct { m_float x, y, z; } m_vec3;
16typedef struct { m_float x, y, z, w; } m_vec4;
17typedef _Complex float m_complex;
18#define SZ_INT sizeof(m_uint)
19#define SZ_FLOAT sizeof(m_float)
20
21#define INT_F "ti"
22#define UINT_F "tu"
23#define abs labs
24
25/*
26#if sizeof(m_uint) > sizeof(m_float)
27#define SZ_MINVAL SZ_INT
28#else
29#define SZ_MINVAL SZ_FLOAT
30#endif
31*/
_Complex float m_complex
Definition gwcommon.h:17
uintptr_t m_uint
Definition gwcommon.h:11
float m_float
Definition gwcommon.h:13
char * m_str
Definition gwcommon.h:14
unsigned char m_bit
Definition gwcommon.h:12
intptr_t m_int
Definition gwcommon.h:10
m_float x
Definition gwcommon.h:15
m_float w
Definition gwcommon.h:16