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