From e6b78d063953a662a2c9746735674e2f40152508 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 17 May 2026 01:10:43 +0300 Subject: [PATCH] comptime: fix `$if tinyc` generating always-false condition TCC defines __GNUC__ as a compatibility macro, so the condition `defined(__TINYC__) && !defined(__GNUC__)` is always false. Revert to just `defined(__TINYC__)` like all other compiler checks. This also makes the github_job workaround unnecessary since the existing `$if tinyc` skip now works correctly again. --- vlib/v/checker/comptime.v | 10 +--------- vlib/v/compiler_errors_test.v | 6 ------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/vlib/v/checker/comptime.v b/vlib/v/checker/comptime.v index 5bf07c763..325237e70 100644 --- a/vlib/v/checker/comptime.v +++ b/vlib/v/checker/comptime.v @@ -2169,15 +2169,7 @@ fn (mut c Checker) comptime_if_cond(mut cond ast.Expr, mut sb strings.Builder) ( return false, false } if ifdef := ast.comptime_if_to_ifdef(cname, c.pref) { - if cname == 'tinyc' { - // `__TINYC__` can be force-defined for ABI compatibility - // (e.g. mbedtls precompiled .o files). Exclude clang/gcc so - // that tcc-only intrinsics (tcc_backtrace, inline asm) are - // not emitted when the fallback compiler is clang/gcc. - sb.write_string('(defined(__TINYC__) && !defined(__clang__) && !defined(__GNUC__))') - } else { - sb.write_string('defined(${ifdef})') - } + sb.write_string('defined(${ifdef})') } else { sb.write_string('${is_true}') } diff --git a/vlib/v/compiler_errors_test.v b/vlib/v/compiler_errors_test.v index 84e98a056..872586d5f 100644 --- a/vlib/v/compiler_errors_test.v +++ b/vlib/v/compiler_errors_test.v @@ -255,12 +255,6 @@ fn (mut tasks Tasks) run() { m_skip_files << 'vlib/v/checker/tests/comptime_value_d_in_include_errors.vv' m_skip_files << 'vlib/v/checker/tests/missing_shader_header_1.vv' } - if github_job.contains('tcc') { - m_skip_files << 'vlib/v/checker/tests/missing_c_lib_header_1.vv' - m_skip_files << 'vlib/v/checker/tests/missing_c_lib_header_with_explanation_2.vv' - m_skip_files << 'vlib/v/checker/tests/comptime_value_d_in_include_errors.vv' - m_skip_files << 'vlib/v/checker/tests/missing_shader_header_1.vv' - } $if msvc { m_skip_files << 'vlib/v/checker/tests/asm_alias_does_not_exist.vv' m_skip_files << 'vlib/v/checker/tests/asm_immutable_err.vv' -- 2.39.5