From 10108c75a5971d142ca5092b2fee56f4d3c4ee74 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 28 Dec 2012 09:08:29 -0800 Subject: [PATCH] Implement signbit for MSVC. --- format.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/format.cc b/format.cc index d27e132d..6779973f 100644 --- a/format.cc +++ b/format.cc @@ -135,6 +135,16 @@ void FormatDecimal(char *buffer, uint64_t value, unsigned num_digits) { buffer[1] = DIGITS[index + 1]; buffer[0] = DIGITS[index]; } + +#ifdef _MSC_VER +int signbit(double value) { + if (value < 0) return 1; + if (!isnan(value)) return 0; + int dec = 0, sign = 0; + ecvt(value, 0, &dec, &sign); + return sign; +} +#endif } void BasicFormatter::operator<<(int value) {