From ece5fa183c79e6aef68eb1b53065f43e7945b79e Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 23 Sep 2021 13:48:41 +0300 Subject: [PATCH] fast.v: freebsd fixes --- vlib/net/tcp_simple_client_server_test.v | 5 ++++- vlib/v/gen/c/cgen.v | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/vlib/net/tcp_simple_client_server_test.v b/vlib/net/tcp_simple_client_server_test.v index 317933fc95..21fa46b3b8 100644 --- a/vlib/net/tcp_simple_client_server_test.v +++ b/vlib/net/tcp_simple_client_server_test.v @@ -118,7 +118,10 @@ fn test_socket_write_fail_without_panic() { $if solaris { return } - // TODO: fix segfaulting on Solaris + $if freebsd { + return + } + // TODO: fix segfaulting on Solaris and FreeBSD for i := 0; i < 3; i++ { socket.write_string(message2) or { println('write to a socket without a recipient should produce an option fail: $err | $message2') diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 9e4ffa7cac..9487352986 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -416,8 +416,13 @@ pub fn (mut g Gen) init() { #endif' g.cheaders.writeln(tcc_undef_has_include) g.includes.writeln(tcc_undef_has_include) - g.cheaders.writeln(get_guarded_include_text('', 'The C compiler can not find . Please install build-essentials')) // int64_t etc - g.cheaders.writeln(get_guarded_include_text('', 'The C compiler can not find . Please install build-essentials')) // size_t, ptrdiff_t + if g.pref.os == .freebsd { + g.cheaders.writeln('#include ') + g.cheaders.writeln('#include ') + } else { + g.cheaders.writeln(get_guarded_include_text('', 'The C compiler can not find . Please install build-essentials')) // int64_t etc + g.cheaders.writeln(get_guarded_include_text('', 'The C compiler can not find . Please install build-essentials')) // size_t, ptrdiff_t + } g.cheaders.writeln(c_builtin_types) if g.pref.is_bare { g.cheaders.writeln(c_bare_headers)