gwion-util
utilities for the Gwion project
Loading...
Searching...
No Matches
include
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 */
11
typedef
intptr_t
m_int
;
12
typedef
uintptr_t
m_uint
;
13
typedef
unsigned
char
m_bit
;
14
typedef
float
m_float
;
15
typedef
char
*
m_str
;
16
typedef
struct
{
m_float
x
,
y
,
z
; }
m_vec3
;
17
typedef
struct
{
m_float
x
,
y
,
z
,
w
; }
m_vec4
;
18
typedef
_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
*/
m_complex
_Complex float m_complex
Definition
gwcommon.h:18
m_uint
uintptr_t m_uint
Definition
gwcommon.h:12
m_float
float m_float
Definition
gwcommon.h:14
m_str
char * m_str
Definition
gwcommon.h:15
m_bit
unsigned char m_bit
Definition
gwcommon.h:13
m_int
intptr_t m_int
Definition
gwcommon.h:11
m_vec3
Definition
gwcommon.h:16
m_vec3::z
m_float z
Definition
gwcommon.h:16
m_vec3::x
m_float x
Definition
gwcommon.h:16
m_vec3::y
m_float y
Definition
gwcommon.h:16
m_vec4
Definition
gwcommon.h:17
m_vec4::w
m_float w
Definition
gwcommon.h:17
m_vec4::x
m_float x
Definition
gwcommon.h:17
m_vec4::y
m_float y
Definition
gwcommon.h:17
m_vec4::z
m_float z
Definition
gwcommon.h:17
Generated by
1.13.2