all repos — mgba @ 404332e68962e0658cf63f1faca1e722174be276

mGBA Game Boy Advance Emulator

include/mgba-util/formatting.h (view raw)

 1/* Copyright (c) 2013-2015 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef FORMATTING_H
 7#define FORMATTING_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include "locale.h"
14
15#if defined(__APPLE__) || defined(__FreeBSD__)
16#include "xlocale.h"
17#elif !defined(HAVE_LOCALE)
18typedef const char* locale_t;
19#endif
20
21int ftostr_l(char* restrict str, size_t size, float f, locale_t locale);
22
23#ifndef HAVE_STRTOF_L
24float strtof_l(const char* restrict str, char** restrict end, locale_t locale);
25#endif
26
27int ftostr_u(char* restrict str, size_t size, float f);
28float strtof_u(const char* restrict str, char** restrict end);
29
30#ifndef HAVE_LOCALTIME_R
31struct tm* localtime_r(const time_t* timep, struct tm* result);
32#endif
33
34CXX_GUARD_END
35
36#endif