Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgen: update to tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7 #20753

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions vlib/v/compiler_errors_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,12 @@ fn (mut tasks Tasks) run() {
m_skip_files = []
}
$if tinyc {
// Note: tcc does not support __has_include, so the detection mechanism
// used for the other compilers does not work. It still provides a
// cleaner error message, than a generic C error, but without the explanation.
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'
// tcc work now, tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7
// // Note: tcc does not support __has_include, so the detection mechanism
// // used for the other compilers does not work. It still provides a
// // cleaner error message, than a generic C error, but without the explanation.
// 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'
}
$if msvc {
m_skip_files << 'vlib/v/checker/tests/asm_alias_does_not_exist.vv'
Expand Down
18 changes: 10 additions & 8 deletions vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -771,14 +771,16 @@ pub fn (mut g Gen) init() {
g.cheaders.writeln('#include <stdint.h>')
g.cheaders.writeln('#include <stddef.h>')
} else {
tcc_undef_has_include := '
#if defined(__TINYC__) && defined(__has_include)
// tcc does not support has_include properly yet, turn it off completely
#undef __has_include
#endif'
g.preincludes.writeln(tcc_undef_has_include)
g.cheaders.writeln(tcc_undef_has_include)
g.includes.writeln(tcc_undef_has_include)
// tcc work now, tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7
// tcc_undef_has_include := '
// #if defined(__TINYC__) && defined(__has_include)
// // tcc does not support has_include properly yet, turn it off completely
// #undef __has_include
// #endif'
// g.preincludes.writeln(tcc_undef_has_include)
// g.cheaders.writeln(tcc_undef_has_include)
// g.includes.writeln(tcc_undef_has_include)

if g.pref.os == .freebsd {
g.cheaders.writeln('#include <inttypes.h>')
g.cheaders.writeln('#include <stddef.h>')
Expand Down
13 changes: 7 additions & 6 deletions vlib/v/gen/c/cheaders.v
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ const c_common_macros = '
#endif

#ifdef __TINYC__
#define _Atomic volatile
// tcc work now, tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7
// #define _Atomic volatile
#undef EMPTY_STRUCT_DECLARATION
#undef EMPTY_STRUCT_INITIALIZATION
#define EMPTY_STRUCT_DECLARATION unsigned char _dummy_pad
Expand Down Expand Up @@ -403,11 +404,11 @@ const c_common_macros = '
#define _MOV
#endif

// tcc does not support has_include properly yet, turn it off completely
#if defined(__TINYC__) && defined(__has_include)
#undef __has_include
#endif

// tcc work now, tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7
// // tcc does not support has_include properly yet, turn it off completely
// #if defined(__TINYC__) && defined(__has_include)
// #undef __has_include
// #endif

#if !defined(VWEAK)
#define VWEAK __attribute__((weak))
Expand Down
Loading