mirror of
https://github.com/libretro/RetroArch
synced 2024-07-05 09:48:42 +00:00
(retroarch.c) Add --log-file and --version
This commit is contained in:
parent
4e595b34c1
commit
ecede41cb2
2
Makefile
2
Makefile
|
@ -1,3 +1,5 @@
|
||||||
|
HAVE_FILE_LOGGER=1
|
||||||
|
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
TARGET = retroarch
|
TARGET = retroarch
|
||||||
|
|
|
@ -37,6 +37,10 @@ ifeq ($(TDM_GCC),)
|
||||||
LDCXXFLAGS += -static-libstdc++
|
LDCXXFLAGS += -static-libstdc++
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||||
|
CFLAGS += -DHAVE_FILE_LOGGER -Ilogger/netlogger
|
||||||
|
endif
|
||||||
|
|
||||||
CFLAGS += -I./libretro-common/include
|
CFLAGS += -I./libretro-common/include
|
||||||
|
|
||||||
# Switches
|
# Switches
|
||||||
|
|
20
retroarch.c
20
retroarch.c
|
@ -457,6 +457,10 @@ static void parse_input(int argc, char *argv[])
|
||||||
{ "subsystem", 1, NULL, 'Z' },
|
{ "subsystem", 1, NULL, 'Z' },
|
||||||
{ "max-frames", 1, NULL, 'm' },
|
{ "max-frames", 1, NULL, 'm' },
|
||||||
{ "eof-exit", 0, &val, 'e' },
|
{ "eof-exit", 0, &val, 'e' },
|
||||||
|
{ "version", 0, &val, 'V' },
|
||||||
|
#ifdef HAVE_FILE_LOGGER
|
||||||
|
{ "log-file", 1, &val, 'L' },
|
||||||
|
#endif
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -662,7 +666,7 @@ static void parse_input(int argc, char *argv[])
|
||||||
runloop->frames.video.max = strtoul(optarg, NULL, 10);
|
runloop->frames.video.max = strtoul(optarg, NULL, 10);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0: /* options without short variant */
|
||||||
switch (val)
|
switch (val)
|
||||||
{
|
{
|
||||||
case 'M':
|
case 'M':
|
||||||
|
@ -743,6 +747,16 @@ static void parse_input(int argc, char *argv[])
|
||||||
global->bsv.eof_exit = true;
|
global->bsv.eof_exit = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'V':
|
||||||
|
print_version();
|
||||||
|
exit(0);
|
||||||
|
|
||||||
|
#ifdef HAVE_FILE_LOGGER
|
||||||
|
case 'L':
|
||||||
|
global->log_file = fopen(optarg, "wb");
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1169,6 +1183,10 @@ error:
|
||||||
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
|
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
|
||||||
int *argc, char **argv)
|
int *argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_FILE_LOGGER
|
||||||
|
int i;
|
||||||
|
#endif
|
||||||
|
|
||||||
*argc = 0;
|
*argc = 0;
|
||||||
argv[(*argc)++] = strdup("retroarch");
|
argv[(*argc)++] = strdup("retroarch");
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#if defined(HAVE_FILE_LOGGER) && defined(RARCH_INTERNAL)
|
#if defined(HAVE_FILE_LOGGER) && defined(RARCH_INTERNAL) && !defined(IS_JOYCONFIG)
|
||||||
|
FILE *rarch_main_log_file(void);
|
||||||
#define LOG_FILE (rarch_main_log_file())
|
#define LOG_FILE (rarch_main_log_file())
|
||||||
#else
|
#else
|
||||||
#define LOG_FILE (stderr)
|
#define LOG_FILE (stderr)
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define IS_JOYCONFIG
|
||||||
|
|
||||||
#include "retroarch-joyconfig.c"
|
#include "retroarch-joyconfig.c"
|
||||||
|
|
||||||
#include "../libretro-common/dynamic/dylib.c"
|
#include "../libretro-common/dynamic/dylib.c"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user