Skip to content

Commit

Permalink
Fix another tcc regresson on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Feb 13, 2024
1 parent 6c6af6d commit 7552613
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 0 additions & 2 deletions libr/anal/c/libtcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,6 @@ typedef struct FlagDef {
const char *name;
} FlagDef;

typedef void (*TccCallback)(const char *, char **);

R_API void tcc_set_callback(TCCState *s, TccCallback cb, char **p) {
if (cb) {
s->cb = cb;
Expand Down
3 changes: 2 additions & 1 deletion libr/anal/c/libtcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ R_API int tcc_relocate(TCCState *s1, void *ptr);
/* return symbol value or NULL if not found */
R_API void *tcc_get_symbol(TCCState *s, const char *name);

typedef void (*TccCallback)(const char *, char **);

R_API void tcc_set_callback(TCCState *s, void (*cb)(const char *,char**), char **p);
R_API void tcc_set_callback(TCCState *s, TccCallback cb, char **p);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion libr/cons/cpipe.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2009-2022 - pancake */
/* radare - LGPL - Copyright 2009-2024 - pancake */

#include <r_cons.h>
#include <r_th.h>
Expand Down
14 changes: 7 additions & 7 deletions libr/core/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3927,15 +3927,14 @@ static char *find_eoq(char *p) {

static char* findSeparator(char *p) {
char *q = strchr (p, '+');
if (q) {
return q;
}
return strchr (p, '-');
return q? q: strchr (p, '-');
}

static void tmpenvs_free(void *item) {
r_sys_setenv (item, NULL);
free (item);
if (item) {
r_sys_setenv (item, NULL);
free (item);
}
}

static bool set_tmp_arch(RCore *core, char *arch, char **tmparch) {
Expand All @@ -3947,7 +3946,7 @@ static bool set_tmp_arch(RCore *core, char *arch, char **tmparch) {
}

static bool set_tmp_bits(RCore *core, int bits, char **tmpbits, int *cmd_ignbithints) {
r_return_val_if_fail (tmpbits, false);
R_RETURN_VAL_IF_FAIL (tmpbits, false);
*tmpbits = strdup (r_config_get (core->config, "asm.bits"));
r_config_set_i (core->config, "asm.bits", bits);
core->fixedbits = true;
Expand All @@ -3958,6 +3957,7 @@ static bool set_tmp_bits(RCore *core, int bits, char **tmpbits, int *cmd_ignbith
}

static char *r_core_cmd_find_subcmd_begin(char *cmd) {
R_RETURN_VAL_IF_FAIL (cmd, NULL);
int quote = 0;
char *p;
for (p = cmd; *p; p++) {
Expand Down

0 comments on commit 7552613

Please sign in to comment.