refactor, libc made optional

This commit is contained in:
veclavtlica
2026-09-14 12:21:49 +03:00
parent 26f6ba56e9
commit 1125073568
14 changed files with 178 additions and 152 deletions
+4 -13
View File
@@ -10,17 +10,15 @@
#define COM_DEF_COMPILE_MODERN 1
#endif
#define COM_DEF_TARGET_NATIVE 0
#define COM_DEF_TARGET_LINUX 0
#define COM_DEF_TARGET_WASM 1
#if defined(__wasm__)
#define COM_DEF_NOSTD 1
#define COM_DEF_TARGET COM_DEF_TARGET_WASM
/* TODO: Move to std.h instead, forbid stdlib on any platform. */
#define assert(m_t) (m_t)
#define printf(...) ((void)0)
#define com_def_export_sym(m_s) __attribute__((export_name(m_s)))
#else
#define COM_DEF_TARGET COM_DEF_TARGET_NATIVE
#define COM_DEF_TARGET COM_DEF_TARGET_LINUX
#define com_def_export_sym(m_s) __attribute__((visibility("default")))
#endif
/* TODO: uppercase? */
@@ -33,13 +31,6 @@
#define com_def_vector(v_t, v_v, v_n) v_t v_v[v_n]
#endif
#define COM_DEF_VECTOR_NONE 0
#define COM_DEF_VECTOR_SSE2 1
#ifdef COM_DEF_COMPILE_MODERN
#define COM_DEF_VECTOR_IMPL COM_DEF_VECTOR_SSE2
#endif
// #define COM_DEF_PROFILE_VAR volatile /* Sadly, doesn't work in some cases */
#define COM_DEF_PROFILE_SINK(m_v) __asm__ volatile("" ::"r"(m_v) : "memory")