Fix builds issues on meson, windows, ios, static and wasi

This commit is contained in:
pancake 2021-10-19 20:57:19 +02:00 committed by GitHub
parent 6ae90339fd
commit fdde9caaad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 10 deletions

View File

@ -2,6 +2,18 @@
#include "r2r.h"
#if __wasi__
static int pipe(int fildes[2]) {return -1;}
static int dup2(int a, int b) {return -1;}
static int waitpid(int a, void *b, int c) {return -1;}
static int kill(int a, int b) {return -1;}
static int execvp(const char *a, char **b) {return -1;}
#define WNOHANG 0
#define WIFEXITED(x) 0
#define WEXITSTATUS(x) 0
#define __SIG_IGN 0
#endif
#if __WINDOWS__
struct r2r_subprocess_t {
HANDLE stdin_write;

View File

@ -9,8 +9,8 @@
#define USE_R2 1
#undef S_API
#define S_API static
#include "../../shlr/spp/spp.c"
// #include <spp/spp.h>
// #include "../../shlr/spp/spp.c"
#include <spp/spp.h>
#include <config.h>
R_LIB_VERSION (r_asm);

View File

@ -39,7 +39,7 @@ STATIC_OBJS=$(addprefix $(LTOP)/core/p/,$(STATIC_OBJ))
OBJS+=$(STATIC_OBJS)
include $(TOP)/shlr/gdb/deps.mk
include $(LIBR)/util/spp.mk
# include $(LIBR)/util/spp.mk
include $(LTOP)/rules.mk
include $(STOP)/java/deps.mk

View File

@ -324,6 +324,8 @@ typedef int (*PrintfCallback)(const char *str, ...) R_PRINTF_CHECK(1, 2);
#endif
#endif
#define R_HIDDEN __attribute__((visibility("hidden")))
#define R_LIB_VERSION_HEADER(x) \
R_API const char *x##_version(void)
#define R_LIB_VERSION(x) \

View File

@ -7,8 +7,8 @@
static RLang *Glang = NULL;
#undef S_API
#define S_API static
#include "../../../shlr/spp/spp.c"
// #include "../../../shlr/spp/spp.c"
#include "../../../shlr/spp/spp.h"
#include "spp_r2.inc"
static bool lang_spp_init(RLang *l) {

View File

@ -71,7 +71,7 @@ endif
endif
SDB_URL=git://github.com/radareorg/sdb
#SDB_URL=/Users/pancake/prg/sdb
SPP_URL=git://github.com/radare/spp
SPP_URL=git://github.com/trufae/spp
PWD=$(shell pwd)
SDB_CONFIG=${PWD}/sdb-config.mk

View File

@ -70,7 +70,7 @@ static char *spp_run_str(char *buf, int *rv) {
return b;
}
void lbuf_strcat(SppBuf *dst, char *src) {
S_API void lbuf_strcat(SppBuf *dst, char *src) {
int len = strlen (src);
char *nbuf;
if (!dst->lbuf || (len + dst->lbuf_n) > dst->lbuf_s) {
@ -85,7 +85,7 @@ void lbuf_strcat(SppBuf *dst, char *src) {
dst->lbuf_n += len;
}
int do_fputs(Output *out, char *str) {
S_API int do_fputs(Output *out, char *str) {
int i;
int printed = 0;
for (i = 0; i <= proc->state.ifl; i++) {
@ -334,7 +334,7 @@ S_API void spp_proc_set(SppProc *p, const char *arg, int fail) {
}
}
void out_printf(Output *out, char *str, ...) {
S_API void out_printf(Output *out, char *str, ...) {
va_list ap;
va_start (ap, str);
if (out->fout) {

View File

@ -1,4 +1,4 @@
w32dbg_wrap_inc = include_directories('include')
w32dbg_wrap_inc = include_directories(['include', '../../libr/include'])
w32dbg_wrap_src = ['src/w32dbg_wrap.c']
w32dbg_wrap_lib = static_library(
'r2w32dbg_wrap',