1
0
Fork 0

Added: base types and helper macros

Browse Source
This commit is contained in:
rhuibertsjr 2024-04-13 14:14:34 +02:00
parent 948f4159b3
commit b9abdc8fce

29
src/base.h Normal file
View File

@ -0,0 +1,29 @@
#ifndef BASE_H
#define BASE_H
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#define internal static
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t i8;
typedef int16_t i16;
typedef int32_t i32;
typedef int64_t i64;
#define KB(b) ((b) << 10)
#define MB(b) ((b) << 20)
#define STATEMENT(S) do{ S } while(0)
#define ASSERT(c) STATEMENT( if (!(c)){ (*(volatile int*)0 = 0); } )
#define MIN(A,B) (((A)<(B))?(A):(B))
#endif // BASE_H