#pragma once
#include "preproc_env.h"
#include "bld_paths.c"
#include "stb_sprintf.h"

#define IO_VSNPRINTF stbsp_vsnprintf
#define IO_SNPRINTF stbsp_snprintf
#include "io.h"

#define MA_ENABLE_SCRATCH
#define MA_ASSERT(x) IO_Assert(x)
#include "arena.h"

#define S8_VSNPRINTF stbsp_vsnprintf
#define S8_Allocator MA_Arena *
#define S8_ALLOCATE(allocator, size) MA_PushSize(allocator, size)
#define S8_ASSERT(x) IO_Assert(x)
#define S8_MemoryCopy MA_MemoryCopy
#include "string.h"

#include "unicode.h"
#include "hash.h"
#include "linked_list.h"

#define RE_PushSize MA_PushSize
#define RE_Arena MA_Arena
#define RE_ArenaFromBuffer MA_MakeFromBuffer
#define RE_ASSERT(x) IO_Assert(x)
#define RE__MemoryZero MA_MemoryZero
#include "regex.h"

#define MU_ASSERT IO_Assert
#include "multimedia.h"

#include "load_library.h"
#include "filesystem.h"

#ifdef __cplusplus
    #include "defer.hpp"
    #define TABLE_ASSERT IO_Assert
    #include "table.hpp"
    #define ARRAY_ASSERT IO_Assert
    #include "array.hpp"
#endif

#define lengthof(x) ((int64_t)((sizeof(x) / sizeof((x)[0]))))
#define Unused(x) (void)(x)
#define Transmute(T, x) (*(T *)&(x))

// #define CL_Arena MA_Arena
// #define CL_PushSize MA_PushSizeNonZeroed
// #define CL_ASSERT IO_Assert
// #define CL_VSNPRINTF stbsp_vsnprintf
// #define CL_SNPRINTF stbsp_snprintf
// #include "clexer.h"
// #include "cpreproc.h"

// #define VIS_MemoryCopy MA_MemoryCopy
// #define VIS_MemoryZero MA_MemoryZero
// #define VIS_ASSERT IO_Assert
// #include "visualize.h"
