getcpu is reserved by linux's sched.h ##build

This commit is contained in:
pancake 2023-03-21 12:34:26 +01:00
parent d6e7c1e162
commit 4ca2579454
1 changed files with 4 additions and 7 deletions

View File

@ -1,14 +1,11 @@
/* Copyright (C) 2008-2022 - pancake */ /* Copyright (C) 2008-2023 - pancake */
#include <r_arch.h> #include <r_arch.h>
#include "binutils_as.c" #include "binutils_as.c"
static const char *getcpu(RArchSession *s) { static const char *mycpu(RArchSession *s) {
const char *cpu = s->config->cpu; const char *cpu = s->config->cpu;
if (!cpu) { return cpu? cpu: R_SYS_ARCH;
return R_SYS_ARCH;
}
return cpu;
} }
#define ASSEMBLER32 "R2_ARM32_AS" #define ASSEMBLER32 "R2_ARM32_AS"
@ -20,7 +17,7 @@ static bool as_encode(RArchSession *s, RAnalOp *op, RArchEncodeMask mask) {
// TODO: find in PATH // TODO: find in PATH
gas = strdup ("as"); gas = strdup ("as");
} }
const char *cpu = getcpu (s); const char *cpu = mycpu (s);
if (!strcmp (cpu, "ppc")) { if (!strcmp (cpu, "ppc")) {
char cmd_opt[4096]; char cmd_opt[4096];
snprintf (cmd_opt, sizeof (cmd_opt), "-mregnames -a%d %s", s->config->bits, snprintf (cmd_opt, sizeof (cmd_opt), "-mregnames -a%d %s", s->config->bits,