mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-29 21:32:49 +00:00
This commit is contained in:
parent
d052bdae02
commit
a684d0cebf
11
format.cc
11
format.cc
@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <cstdarg>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ inline int IsInf(double x) {
|
|||||||
|
|
||||||
#define FMT_SNPRINTF snprintf
|
#define FMT_SNPRINTF snprintf
|
||||||
|
|
||||||
#else
|
#else // _MSC_VER
|
||||||
|
|
||||||
inline int SignBit(double value) {
|
inline int SignBit(double value) {
|
||||||
if (value < 0) return 1;
|
if (value < 0) return 1;
|
||||||
@ -70,7 +71,13 @@ inline int SignBit(double value) {
|
|||||||
|
|
||||||
inline int IsInf(double x) { return !_finite(x); }
|
inline int IsInf(double x) { return !_finite(x); }
|
||||||
|
|
||||||
#define FMT_SNPRINTF sprintf_s
|
inline int FMT_SNPRINTF(char *buffer, size_t size, const char *format, ...) {
|
||||||
|
va_list args;
|
||||||
|
va_start(args, format);
|
||||||
|
int result = vsnprintf_s(buffer, size, _TRUNCATE, format, args);
|
||||||
|
va_end(args);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user