all repos — mgba @ e11e5ef9707163895b454fbbdcab9670244e5ae9

mGBA Game Boy Advance Emulator

util: Formatting cleanup
Vicki Pfau vi@endrift.com
Mon, 02 Jul 2018 20:42:20 -0700
commit

e11e5ef9707163895b454fbbdcab9670244e5ae9

parent

4d49aa095b000f2f869d53d7e1c0f527d6858e88

2 files changed, 12 insertions(+), 5 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -311,11 +311,13 @@ add_definitions(-D_GNU_SOURCE)

endif() include(CheckFunctionExists) +include(CheckIncludeFiles) check_function_exists(strdup HAVE_STRDUP) check_function_exists(strndup HAVE_STRNDUP) if(NOT DEFINED PSP2) check_function_exists(localtime_r HAVE_LOCALTIME_R) endif() +check_include_files("xlocale.h" HAVE_XLOCALE) if(NOT CMAKE_SYSTEM_NAME STREQUAL "Generic") check_function_exists(snprintf_l HAVE_SNPRINTF_L) if(CMAKE_SYSTEM_NAME STREQUAL "Linux")

@@ -373,9 +375,6 @@ endif()

if(HAVE_NEWLOCALE AND HAVE_FREELOCALE AND HAVE_USELOCALE OR APPLE) list(APPEND FUNCTION_DEFINES HAVE_LOCALE) - if (HAVE_STRTOF_L) - list(APPEND FUNCTION_DEFINES HAVE_STRTOF_L) - endif() if (HAVE_SNPRINTF_L) list(APPEND FUNCTION_DEFINES HAVE_SNPRINTF_L) endif()

@@ -383,6 +382,14 @@ endif()

if(HAVE_SETLOCALE) list(APPEND FUNCTION_DEFINES HAVE_SETLOCALE) +endif() + +if (HAVE_STRTOF_L) + list(APPEND FUNCTION_DEFINES HAVE_STRTOF_L) +endif() + +if(HAVE_XLOCALE) + list(APPEND FUNCTION_DEFINES HAVE_XLOCALE) endif() if(HAVE_CHMOD)
M include/mgba-util/formatting.hinclude/mgba-util/formatting.h

@@ -12,8 +12,8 @@ CXX_GUARD_START

#include "locale.h" -#if defined(__APPLE__) || defined(__FreeBSD__) -#include "xlocale.h" +#ifdef HAVE_XLOCALE +#include <xlocale.h> #elif !defined(HAVE_LOCALE) typedef const char* locale_t; #endif