diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index 50e60a35dc..0683d85cf6 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -30,8 +30,6 @@ fn on_panic(f fn (int) int) { // TODO } -fn C.backtrace(voidptr, int) int - pub fn print_backtrace_skipping_top_frames(skipframes int) { $if mac { buffer := [100]byteptr diff --git a/vlib/builtin/cdefs.v b/vlib/builtin/cdefs.v index 697475b586..ba280e73bc 100644 --- a/vlib/builtin/cdefs.v +++ b/vlib/builtin/cdefs.v @@ -1,5 +1,7 @@ module builtin +fn backtrace(a voidptr, b int) int + fn C.memcpy(byteptr, byteptr, int) fn C.memmove(byteptr, byteptr, int) //fn C.malloc(int) byteptr @@ -8,6 +10,12 @@ fn C.realloc(a byteptr, b int) byteptr fn C.qsort(voidptr, int, int, voidptr) fn C.sprintf(a ...voidptr) byteptr +fn C.strlen(s byteptr) int + + + +fn backtrace_symbols_fd(voidptr, int, int) + // Windows diff --git a/vlib/builtin/string.v b/vlib/builtin/string.v index e3b8691048..bb51dfb8e5 100644 --- a/vlib/builtin/string.v +++ b/vlib/builtin/string.v @@ -58,15 +58,10 @@ pub: len int } -// For C strings only -fn C.strlen(s byteptr) int - pub fn vstrlen(s byteptr) int { return C.strlen(*char(s)) } -fn todo() { } - // Converts a C string to a V string. // String data is reused, not copied. pub fn tos(s byteptr, len int) string { diff --git a/vlib/compiler/cheaders.v b/vlib/compiler/cheaders.v index c1df0d850b..47404d44ef 100644 --- a/vlib/compiler/cheaders.v +++ b/vlib/compiler/cheaders.v @@ -21,13 +21,14 @@ CommonCHeaders = ' #ifdef __APPLE__ #include // proc_pidpath -#include // backtrace and backtrace_symbols_fd +//#include // backtrace and backtrace_symbols_fd #endif #ifdef __linux__ -#ifndef __BIONIC__ -#include // backtrace and backtrace_symbols_fd -#endif +//#if !defined(__BIONIC__) && !defined(__GNUC_PREREQ) +//#include // backtrace and backtrace_symbols_fd +//#endif + #pragma weak backtrace #pragma weak backtrace_symbols_fd #endif diff --git a/vlib/compiler/fn.v b/vlib/compiler/fn.v index 6a408f5fab..58dcc55748 100644 --- a/vlib/compiler/fn.v +++ b/vlib/compiler/fn.v @@ -352,7 +352,7 @@ fn (p mut Parser) fn_decl() { } // Translated C code and .vh can have empty functions (just definitions) is_fn_header := !is_c && !p.is_vh && - (p.pref.translated || p.pref.is_test || p.is_vh) && + //(p.pref.translated || p.pref.is_test || p.is_vh) && p.tok != .lcbr if is_fn_header { f.is_decl = true