2023-09-09 17:14:40 -07:00
|
|
|
#pragma once
|
|
|
|
|
2023-09-08 18:08:57 -07:00
|
|
|
// Keywords
|
|
|
|
|
|
|
|
#define global static // Global variables
|
|
|
|
#define internal static // Internal linkage
|
|
|
|
#define local_persist static // Local Persisting variables
|
2023-09-08 21:01:53 -07:00
|
|
|
|
|
|
|
#define api_c extern "C"
|
2023-09-09 00:03:03 -07:00
|
|
|
|
|
|
|
// Casting
|
|
|
|
|
|
|
|
#define ccast( Type, Value ) ( * const_cast< Type* >( & (Value) ) )
|
|
|
|
#define pcast( Type, Value ) ( * reinterpret_cast< Type* >( & ( Value ) ) )
|
|
|
|
#define rcast( Type, Value ) reinterpret_cast< Type >( Value )
|
|
|
|
#define scast( Type, Value ) static_cast< Type >( Value )
|
2023-09-09 20:58:28 -07:00
|
|
|
|
|
|
|
#define do_once() \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
static \
|
|
|
|
bool Done = false; \
|
|
|
|
if ( Done ) \
|
|
|
|
return; \
|
|
|
|
Done = true; \
|
|
|
|
} \
|
|
|
|
while(0)
|
|
|
|
|
|
|
|
#define do_once_start \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
static \
|
|
|
|
bool Done = false; \
|
|
|
|
if ( Done ) \
|
|
|
|
break; \
|
|
|
|
Done = true;
|
|
|
|
|
|
|
|
#define do_once_end \
|
|
|
|
} \
|
|
|
|
while(0);
|