mccu/include/mcutil/mcutil.h

37 lines
794 B
C
Raw Permalink Normal View History

2025-01-28 21:42:26 +00:00
#ifndef _H_MCUTIL
#define _H_MCUTIL
// https://fdiv.net/2015/10/08/emulating-defer-c-clang-or-gccblocks
#ifndef MCU_ALLOC
#define MCU_ALLOC malloc
#endif
#ifndef MCU_REALLOC
#define MCU_REALLOC realloc
#endif
#ifndef MCU_FREE
#define MCU_FREE free
#endif
#if defined(_MSC_VER)
#define MCU_API __declspec(dllexport)
2025-01-29 21:21:18 +00:00
#elif defined(__GNUC__) || defined(__clang__)
2025-01-28 21:42:26 +00:00
#define MCU_API __attribute__((visibility("default")))
#else
#define MCU_API
#pragma warning Unknown dynamic link import/export semantics.
#endif
2025-01-29 21:21:18 +00:00
#ifdef MCUTIL_IMPLEMENTATION
// Add all new files
#include "../../src/collect/gen_vec.c"
#include "../../src/collect/hash_map.c"
#include "../../src/collect/str.c"
#include "../../src/collect/md5.c"
#endif // MCUTIL_IMPLEMENTATION
2025-01-28 21:42:26 +00:00
2025-01-29 21:21:18 +00:00
#endif // _H_MCUTIL