remove execinfo.h header
parent
4e21e9ed44
commit
ea3f9b5b9a
|
@ -30,8 +30,6 @@ fn on_panic(f fn (int) int) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
fn C.backtrace(voidptr, int) int
|
|
||||||
|
|
||||||
pub fn print_backtrace_skipping_top_frames(skipframes int) {
|
pub fn print_backtrace_skipping_top_frames(skipframes int) {
|
||||||
$if mac {
|
$if mac {
|
||||||
buffer := [100]byteptr
|
buffer := [100]byteptr
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
module builtin
|
module builtin
|
||||||
|
|
||||||
|
fn backtrace(a voidptr, b int) int
|
||||||
|
|
||||||
fn C.memcpy(byteptr, byteptr, int)
|
fn C.memcpy(byteptr, byteptr, int)
|
||||||
fn C.memmove(byteptr, byteptr, int)
|
fn C.memmove(byteptr, byteptr, int)
|
||||||
//fn C.malloc(int) byteptr
|
//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.qsort(voidptr, int, int, voidptr)
|
||||||
|
|
||||||
fn C.sprintf(a ...voidptr) byteptr
|
fn C.sprintf(a ...voidptr) byteptr
|
||||||
|
fn C.strlen(s byteptr) int
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fn backtrace_symbols_fd(voidptr, int, int)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Windows
|
// Windows
|
||||||
|
|
|
@ -58,15 +58,10 @@ pub:
|
||||||
len int
|
len int
|
||||||
}
|
}
|
||||||
|
|
||||||
// For C strings only
|
|
||||||
fn C.strlen(s byteptr) int
|
|
||||||
|
|
||||||
pub fn vstrlen(s byteptr) int {
|
pub fn vstrlen(s byteptr) int {
|
||||||
return C.strlen(*char(s))
|
return C.strlen(*char(s))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn todo() { }
|
|
||||||
|
|
||||||
// Converts a C string to a V string.
|
// Converts a C string to a V string.
|
||||||
// String data is reused, not copied.
|
// String data is reused, not copied.
|
||||||
pub fn tos(s byteptr, len int) string {
|
pub fn tos(s byteptr, len int) string {
|
||||||
|
|
|
@ -21,13 +21,14 @@ CommonCHeaders = '
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <libproc.h> // proc_pidpath
|
#include <libproc.h> // proc_pidpath
|
||||||
#include <execinfo.h> // backtrace and backtrace_symbols_fd
|
//#include <execinfo.h> // backtrace and backtrace_symbols_fd
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#ifndef __BIONIC__
|
//#if !defined(__BIONIC__) && !defined(__GNUC_PREREQ)
|
||||||
#include <execinfo.h> // backtrace and backtrace_symbols_fd
|
//#include <execinfo.h> // backtrace and backtrace_symbols_fd
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
#pragma weak backtrace
|
#pragma weak backtrace
|
||||||
#pragma weak backtrace_symbols_fd
|
#pragma weak backtrace_symbols_fd
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -352,7 +352,7 @@ fn (p mut Parser) fn_decl() {
|
||||||
}
|
}
|
||||||
// Translated C code and .vh can have empty functions (just definitions)
|
// Translated C code and .vh can have empty functions (just definitions)
|
||||||
is_fn_header := !is_c && !p.is_vh &&
|
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
|
p.tok != .lcbr
|
||||||
if is_fn_header {
|
if is_fn_header {
|
||||||
f.is_decl = true
|
f.is_decl = true
|
||||||
|
|
Loading…
Reference in New Issue