From 10c312f55ce3a99f9cb027d6398d235982e6fc8d Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Fri, 13 Dec 2013 02:51:15 -0500 Subject: [PATCH 1/2] - Silence GCC PCD_PRINTBINARY warning since we've been able to since GCC 4.6. --- src/p_acs.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 32a70cd15..582385c48 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -6796,7 +6796,18 @@ scriptwait: break; case PCD_PRINTBINARY: +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6))) +#define HAS_DIAGNOSTIC_PRAGMA +#endif +#ifdef HAS_DIAGNOSTIC_PRAGMA +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat=" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif work.AppendFormat ("%B", STACK(1)); +#ifdef HAS_DIAGNOSTIC_PRAGMA +#pragma GCC diagnostic pop +#endif --sp; break; From 12d45bbc33ed833b1d30f7180e5d3dcca1a0f21e Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Fri, 13 Dec 2013 03:00:35 -0500 Subject: [PATCH 2/2] - Use setenv for LC_NUMERIC since setlocale gets reset by the libraries on some systems. --- src/sdl/i_main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sdl/i_main.cpp b/src/sdl/i_main.cpp index 65b992f6a..1736305d8 100644 --- a/src/sdl/i_main.cpp +++ b/src/sdl/i_main.cpp @@ -257,7 +257,12 @@ int main (int argc, char **argv) #if defined(__MACH__) && !defined(NOASM) unprotect_rtext(); #endif - + + // Set LC_NUMERIC environment variable in case some library decides to + // clear the setlocale call at least this will be correct. + // Note that the LANG environment variable is overridden by LC_* + setenv ("LC_NUMERIC", "C", 1); + #ifndef NO_GTK GtkAvailable = gtk_init_check (&argc, &argv); #endif