remove more C headers
parent
dc2c62807a
commit
7de95a642e
vlib
|
@ -14,9 +14,13 @@ fn C.isdigit(s byteptr) bool
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// <execinfo.h>
|
||||||
fn backtrace(a voidptr, b int) int
|
fn backtrace(a voidptr, b int) int
|
||||||
fn backtrace_symbols_fd(voidptr, int, int)
|
fn backtrace_symbols_fd(voidptr, int, int)
|
||||||
|
|
||||||
|
// <libproc.h>
|
||||||
|
fn proc_pidpath(int, voidptr, int) int
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Windows
|
// Windows
|
||||||
|
|
|
@ -19,21 +19,6 @@ CommonCHeaders = '
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
#include <libproc.h> // proc_pidpath
|
|
||||||
//#include <execinfo.h> // backtrace and backtrace_symbols_fd
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
//#if !defined(__BIONIC__) && !defined(__GNUC_PREREQ)
|
|
||||||
//#include <execinfo.h> // backtrace and backtrace_symbols_fd
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
#pragma weak backtrace
|
|
||||||
#pragma weak backtrace_symbols_fd
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h> // os__wait uses wait on nix
|
#include <sys/wait.h> // os__wait uses wait on nix
|
||||||
|
|
|
@ -12,8 +12,8 @@ import strings
|
||||||
|
|
||||||
/*
|
/*
|
||||||
struct dirent {
|
struct dirent {
|
||||||
d_ino int
|
d_ino int
|
||||||
d_off int
|
d_off int
|
||||||
d_reclen u16
|
d_reclen u16
|
||||||
d_type byte
|
d_type byte
|
||||||
d_name [256]byte
|
d_name [256]byte
|
||||||
|
@ -700,7 +700,7 @@ pub fn executable() string {
|
||||||
$if mac {
|
$if mac {
|
||||||
mut result := malloc(MAX_PATH)
|
mut result := malloc(MAX_PATH)
|
||||||
pid := C.getpid()
|
pid := C.getpid()
|
||||||
ret := C.proc_pidpath (pid, result, MAX_PATH)
|
ret := proc_pidpath (pid, result, MAX_PATH)
|
||||||
if ret <= 0 {
|
if ret <= 0 {
|
||||||
println('os.executable() failed')
|
println('os.executable() failed')
|
||||||
return '.'
|
return '.'
|
||||||
|
|
Loading…
Reference in New Issue