@@ -180,8 +180,6 @@ const c_common_macros = '
180180#endif
181181#endif
182182
183- #define OPTION_CAST(x) (x)
184-
185183#if defined(_WIN32) || defined(__CYGWIN__)
186184 #define VV_EXP extern __declspec(dllexport)
187185 #define VV_LOC static
@@ -220,7 +218,17 @@ const c_common_macros = '
220218#undef __has_include
221219#endif
222220
221+ //likely and unlikely macros
222+ #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
223+ #define _likely_(x) __builtin_expect(x,1)
224+ #define _unlikely_(x) __builtin_expect(x,0)
225+ #else
226+ #define _likely_(x) (x)
227+ #define _unlikely_(x) (x)
228+ #endif
229+ '
223230
231+ const c_common_weak_attr = '
224232#if !defined(VWEAK)
225233 #define VWEAK __attribute__((weak))
226234 #ifdef _MSC_VER
@@ -232,7 +240,9 @@ const c_common_macros = '
232240 #define VWEAK
233241 #endif
234242#endif
243+ '
235244
245+ const c_common_hidden_attr = '
236246#if !defined(VHIDDEN)
237247 #define VHIDDEN __attribute__((visibility("hidden")))
238248 #ifdef _MSC_VER
@@ -244,7 +254,9 @@ const c_common_macros = '
244254 #define VHIDDEN
245255 #endif
246256#endif
257+ '
247258
259+ const c_common_noreturn_attr = '
248260#if !defined(VNORETURN)
249261 #if defined(__TINYC__)
250262 #include <stdnoreturn.h>
@@ -259,7 +271,9 @@ const c_common_macros = '
259271 #define VNORETURN
260272 #endif
261273#endif
274+ '
262275
276+ const c_common_unreachable_attr = '
263277#if !defined(VUNREACHABLE)
264278 #if defined(__GNUC__) && !defined(__clang__)
265279 #define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)
@@ -276,16 +290,6 @@ const c_common_macros = '
276290 #define VUNREACHABLE() do { } while (0)
277291 #endif
278292#endif
279-
280- //likely and unlikely macros
281- #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
282- #define _likely_(x) __builtin_expect(x,1)
283- #define _unlikely_(x) __builtin_expect(x,0)
284- #else
285- #define _likely_(x) (x)
286- #define _unlikely_(x) (x)
287- #endif
288-
289293'
290294
291295const c_unsigned_comparison_functions = '
@@ -433,8 +437,6 @@ void v_free(voidptr ptr);
433437 #define _Atomic volatile
434438
435439 // MSVC cannot parse some things properly
436- #undef OPTION_CAST
437- #define OPTION_CAST(x)
438440 #undef __NOINLINE
439441 #undef __IRQHANDLER
440442 #define __NOINLINE __declspec(noinline)
@@ -451,9 +453,6 @@ void v_free(voidptr ptr);
451453 #endif
452454#endif
453455
454- // g_live_info is used by live.info()
455- static void* g_live_info = NULL;
456-
457456#if defined(__MINGW32__) || defined(__MINGW64__) || (defined(_WIN32) && defined(__TINYC__))
458457 #undef PRId64
459458 #undef PRIi64
@@ -711,5 +710,4 @@ static inline uint64_t wy2u0k(uint64_t r, uint64_t k){ _wymum(&r,&k); return k;
711710#endif
712711
713712#define _IN_MAP(val, m) map_exists(m, val)
714-
715713'
0 commit comments