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