Started using ev_types in ev_numeric, added ev_internal
Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
17
ev_internal.h
Normal file
17
ev_internal.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef EV_HEADERS_INTERNAL_H
|
||||
#define EV_HEADERS_INTERNAL_H
|
||||
|
||||
typedef signed char __ev_int8_t;
|
||||
typedef short int __ev_int16_t;
|
||||
typedef int __ev_int32_t;
|
||||
typedef long long int __ev_int64_t;
|
||||
|
||||
typedef unsigned char __ev_uint8_t;
|
||||
typedef unsigned short int __ev_uint16_t;
|
||||
typedef unsigned int __ev_uint32_t;
|
||||
typedef unsigned long long int __ev_uint64_t;
|
||||
|
||||
typedef float __ev_float32_t;
|
||||
typedef double __ev_float64_t;
|
||||
|
||||
#endif // EV_HEADERS_INTERNAL_H
|
||||
23
ev_numeric.h
23
ev_numeric.h
@@ -1,21 +1,24 @@
|
||||
#ifndef EV_HEADERS_NUMERIC_H
|
||||
#define EV_HEADERS_NUMERIC_H
|
||||
|
||||
#include "ev_internal.h"
|
||||
#include "ev_types.h"
|
||||
|
||||
// Signed integers
|
||||
typedef signed char i8;
|
||||
typedef short int i16;
|
||||
typedef int i32;
|
||||
typedef long long int i64;
|
||||
EV_TYPEDEF(i8 , __ev_int8_t); TYPEDATA_GEN(i8);
|
||||
EV_TYPEDEF(i16, __ev_int16_t); TYPEDATA_GEN(i16);
|
||||
EV_TYPEDEF(i32, __ev_int32_t); TYPEDATA_GEN(i32);
|
||||
EV_TYPEDEF(i64, __ev_int64_t); TYPEDATA_GEN(i64);
|
||||
|
||||
// Unsigned integers
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short int u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned long long int u64;
|
||||
EV_TYPEDEF(u8 , __ev_uint8_t); TYPEDATA_GEN(u8);
|
||||
EV_TYPEDEF(u16, __ev_uint16_t); TYPEDATA_GEN(u16);
|
||||
EV_TYPEDEF(u32, __ev_uint32_t); TYPEDATA_GEN(u32);
|
||||
EV_TYPEDEF(u64, __ev_uint64_t); TYPEDATA_GEN(u64);
|
||||
|
||||
// Floating-Point Numbers
|
||||
typedef float f32;
|
||||
typedef double f64;
|
||||
EV_TYPEDEF(f32, __ev_float32_t); TYPEDATA_GEN(f32);
|
||||
EV_TYPEDEF(f64, __ev_float64_t); TYPEDATA_GEN(f64);
|
||||
|
||||
struct Int8Data { i8 MIN; i8 MAX; };
|
||||
struct Int16Data { i16 MIN; i16 MAX; };
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
#define EV_HEADERS_TYPES_H
|
||||
|
||||
#include "ev_macros.h"
|
||||
#include "ev_numeric.h"
|
||||
#include "ev_internal.h"
|
||||
|
||||
typedef void(*ev_copy_fn)(void *dst, void *src);
|
||||
typedef void(*ev_free_fn)(void *self);
|
||||
typedef u64(*ev_hash_fn)(void *self);
|
||||
typedef __ev_uint64_t(*ev_hash_fn)(void *self);
|
||||
|
||||
typedef struct {
|
||||
EV_DEBUG(const char *name;)
|
||||
|
||||
u32 size;
|
||||
u32 alignment;
|
||||
__ev_uint32_t size;
|
||||
__ev_uint32_t alignment;
|
||||
|
||||
ev_copy_fn copy_fn;
|
||||
ev_free_fn free_fn;
|
||||
|
||||
Reference in New Issue
Block a user