X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=logging%2Flog.c;h=7af09e54ed0d77ee00484b67e3aab9d9b7c7ba10;hb=b966c758a620b3f75f8ecf2ed6c3790b2200512e;hp=4561012984e75eb6548a78573e4d597683c1a305;hpb=630c90a183f1a5f4e47647e0592ac4a034668102;p=babeltrace.git diff --git a/logging/log.c b/logging/log.c index 45610129..7af09e54 100644 --- a/logging/log.c +++ b/logging/log.c @@ -310,6 +310,8 @@ extern unsigned long pthread_getsequence_np(pthread_t *); #include #if defined(__linux__) #include + #elif (defined(__sun__) || defined(__CYGWIN__)) + /* Solaris and Cygwin have no sys/syslimits.h */ #else #include #endif @@ -488,7 +490,8 @@ extern unsigned long pthread_getsequence_np(pthread_t *); #define memccpy _memccpy #endif -#if (defined(_MSC_VER) && !defined(__INTEL_COMPILER)) || defined(__MINGW64__) +#if (defined(_MSC_VER) && !defined(__INTEL_COMPILER)) || \ + (defined(__MINGW64__) && !defined(__USE_MINGW_ANSI_STDIO)) #define vsnprintf(s, sz, fmt, va) fake_vsnprintf(s, sz, fmt, va) static int fake_vsnprintf(char *s, size_t sz, const char *fmt, va_list ap) { @@ -740,7 +743,7 @@ static char lvl_char(const int lvl) #define TCACHE_FLUID (0x40000000 | 0x80000000) static unsigned g_tcache_mode = TCACHE_STALE; static struct timeval g_tcache_tv = {0, 0}; -static struct tm g_tcache_tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static struct tm g_tcache_tm = {0}; static INLINE int tcache_get(const struct timeval *const tv, struct tm *const tm) { @@ -903,7 +906,7 @@ static char *put_integer_r(unsigned v, const int sign, const unsigned w, const char wc, char *const e) { static const char _signs[] = {'-', '0', '+'}; - static const char *const signs = _signs + 1; + const char *const signs = _signs + 1; char *p = e; do { *--p = '0' + v % 10; } while (0 != (v /= 10)); if (0 == sign) return put_padding_r(w, wc, p, e);