From b72446d4d69136d74e87e5d8f197e1a236becf9d Mon Sep 17 00:00:00 2001 From: Mahyar Koshkouei Date: Sun, 14 Jan 2018 11:13:02 +0000 Subject: [PATCH] Locale changes Systems that have locale support must be set to "C" locale otherwise libmpv will complain. Signed-off-by: Mahyar Koshkouei --- Makefile | 4 ++++ mpv-libretro.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index bfcae39..fa527a0 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,10 @@ else CFLAGS += -std=gnu99 endif +ifneq (,$(locale)) + CFLAGS += -DHAVE_LOCALE +endif + # Always have some debugging information. CFLAGS += -g ifeq ($(DEBUG), 1) diff --git a/mpv-libretro.c b/mpv-libretro.c index 41dca18..22bc7f7 100644 --- a/mpv-libretro.c +++ b/mpv-libretro.c @@ -22,6 +22,10 @@ #include #include +#ifdef HAVE_LOCALE +#include +#endif + #include #include @@ -163,6 +167,10 @@ static void context_reset(void) { const char *cmd[] = {"loadfile", filepath, NULL}; +#ifdef HAVE_LOCALE + setlocale(LC_NUMERIC, "C"); +#endif + mpv = mpv_create(); if(!mpv)