On Linux, /proc/self/exe is a virtual link to the ELF program being
executed. Use this instead of hardcoding "retroarch.exe".
This is used when compiling Lightrec with disassembler support.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
# define unlikely(x) (x)
#endif
# define unlikely(x) (x)
#endif
+#ifndef LIGHTREC_PROG_NAME
+# ifdef __linux__
+# define LIGHTREC_PROG_NAME "/proc/self/exe"
+# else
+# define LIGHTREC_PROG_NAME "retroarch.exe"
+# endif
+#endif
+
psxRegisters psxRegs;
Rcnt rcnts[4];
psxRegisters psxRegs;
Rcnt rcnts[4];
static struct lightrec_state *lightrec_state;
static struct lightrec_state *lightrec_state;
-static char *name = "retroarch.exe";
-
static bool use_lightrec_interpreter;
static bool use_pcsx_interpreter;
static bool block_stepping;
static bool use_lightrec_interpreter;
static bool use_pcsx_interpreter;
static bool block_stepping;
use_lightrec_interpreter = !!getenv("LIGHTREC_INTERPRETER");
use_lightrec_interpreter = !!getenv("LIGHTREC_INTERPRETER");
- lightrec_state = lightrec_init(name,
+ lightrec_state = lightrec_init(LIGHTREC_PROG_NAME,
lightrec_map, ARRAY_SIZE(lightrec_map),
&lightrec_ops);
lightrec_map, ARRAY_SIZE(lightrec_map),
&lightrec_ops);