1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

remove execinfo.h header

This commit is contained in:
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 // 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

View File

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

View File

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

View File

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

View File

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