mccu/src/include/mcutil.h

30 lines
528 B
C
Raw 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)
#elif defined(__GNUC__)
#define MCU_API __attribute__((visibility("default")))
#else
#define MCU_API
#pragma warning Unknown dynamic link import/export semantics.
#endif
#endif