diff --git a/vlib/builtin/cfns.v b/vlib/builtin/cfns.v index 39bd9bdac8..9dec4340ab 100644 --- a/vlib/builtin/cfns.v +++ b/vlib/builtin/cfns.v @@ -14,9 +14,13 @@ fn C.isdigit(s byteptr) bool +// fn backtrace(a voidptr, b int) int fn backtrace_symbols_fd(voidptr, int, int) +// +fn proc_pidpath(int, voidptr, int) int + // Windows diff --git a/vlib/compiler/cheaders.v b/vlib/compiler/cheaders.v index 47404d44ef..2038e6ef7e 100644 --- a/vlib/compiler/cheaders.v +++ b/vlib/compiler/cheaders.v @@ -19,21 +19,6 @@ CommonCHeaders = ' #endif -#ifdef __APPLE__ -#include // proc_pidpath -//#include // backtrace and backtrace_symbols_fd -#endif - -#ifdef __linux__ -//#if !defined(__BIONIC__) && !defined(__GNUC_PREREQ) -//#include // backtrace and backtrace_symbols_fd -//#endif - -#pragma weak backtrace -#pragma weak backtrace_symbols_fd -#endif - - #ifdef __linux__ #include #include // os__wait uses wait on nix diff --git a/vlib/os/os.v b/vlib/os/os.v index a8e1db596a..f4d7f076eb 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -12,8 +12,8 @@ import strings /* struct dirent { - d_ino int - d_off int + d_ino int + d_off int d_reclen u16 d_type byte d_name [256]byte @@ -700,7 +700,7 @@ pub fn executable() string { $if mac { mut result := malloc(MAX_PATH) pid := C.getpid() - ret := C.proc_pidpath (pid, result, MAX_PATH) + ret := proc_pidpath (pid, result, MAX_PATH) if ret <= 0 { println('os.executable() failed') return '.'