2015-02-11 08:19:55 +00:00
|
|
|
/* Copyright (c) 2013-2015 Jeffrey Pfau
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef FORMATTING_H
|
|
|
|
#define FORMATTING_H
|
|
|
|
|
2016-12-31 01:00:22 +00:00
|
|
|
#include <mgba-util/common.h>
|
2015-02-11 08:19:55 +00:00
|
|
|
|
2016-12-27 05:01:55 +00:00
|
|
|
CXX_GUARD_START
|
|
|
|
|
2015-02-11 08:19:55 +00:00
|
|
|
#include "locale.h"
|
|
|
|
|
2015-02-12 08:37:52 +00:00
|
|
|
#if defined(__APPLE__) || defined(__FreeBSD__)
|
2015-02-11 08:19:55 +00:00
|
|
|
#include "xlocale.h"
|
2016-06-27 03:31:12 +00:00
|
|
|
#elif !defined(HAVE_LOCALE)
|
2015-02-11 08:19:55 +00:00
|
|
|
typedef const char* locale_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int ftostr_l(char* restrict str, size_t size, float f, locale_t locale);
|
|
|
|
|
|
|
|
#ifndef HAVE_STRTOF_L
|
|
|
|
float strtof_l(const char* restrict str, char** restrict end, locale_t locale);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int ftostr_u(char* restrict str, size_t size, float f);
|
|
|
|
float strtof_u(const char* restrict str, char** restrict end);
|
|
|
|
|
2015-09-16 05:23:32 +00:00
|
|
|
#ifndef HAVE_LOCALTIME_R
|
|
|
|
struct tm* localtime_r(const time_t* timep, struct tm* result);
|
|
|
|
#endif
|
|
|
|
|
2016-12-27 05:01:55 +00:00
|
|
|
CXX_GUARD_END
|
|
|
|
|
2015-02-11 08:19:55 +00:00
|
|
|
#endif
|