Added: base types and helper macros
This commit is contained in:
parent
948f4159b3
commit
b9abdc8fce
|
@ -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
|
Loading…
Reference in New Issue
Block a user