remove execinfo.h header

pull/2538/head
Alexander Medvednikov 2019-10-25 12:07:50 +03:00
parent 4e21e9ed44
commit ea3f9b5b9a
5 changed files with 14 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -21,13 +21,14 @@ CommonCHeaders = '
#ifdef __APPLE__
#include <libproc.h> // proc_pidpath
#include <execinfo.h> // backtrace and backtrace_symbols_fd
//#include <execinfo.h> // backtrace and backtrace_symbols_fd
#endif
#ifdef __linux__
#ifndef __BIONIC__
#include <execinfo.h> // backtrace and backtrace_symbols_fd
#endif
//#if !defined(__BIONIC__) && !defined(__GNUC_PREREQ)
//#include <execinfo.h> // backtrace and backtrace_symbols_fd
//#endif
#pragma weak backtrace
#pragma weak backtrace_symbols_fd
#endif

View File

@ -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