Browse Source

[waf] Add missing checks for localtime_r() and gmtime_r()

personal/stbuehler/wip
Thomas Porzelt 13 years ago
parent
commit
1df869edc3
  1. 4
      src/main/log.c
  2. 2
      src/main/server.c
  3. 2
      wscript

4
src/main/log.c

@ -104,8 +104,12 @@ gboolean li_log_write_(liServer *srv, liVRequest *vr, liLogLevel log_level, guin
if (cur_ts != ts->last_ts) {
gsize s;
#ifdef HAVE_LOCALTIME_R
struct tm tm;
#endif
g_string_set_size(ts->cached, 255);
#ifdef HAVE_LOCALTIME_R
s = strftime(ts->cached->str, ts->cached->allocated_len,
ts->format->str, localtime_r(&cur_ts, &tm));

2
src/main/server.c

@ -428,7 +428,9 @@ GString *li_server_current_timestamp() {
if (cur_ts != *last_ts) {
gsize s;
#ifdef HAVE_GMTIME_R
struct tm tm;
#endif
g_string_set_size(ts_str, 255);
#ifdef HAVE_GMTIME_R

2
wscript

@ -152,6 +152,8 @@ def configure(conf):
conf.check(function_name='fpathconf', header_name='unistd.h', define_name='HAVE_FPATHCONF')
conf.check(function_name='pathconf', header_name='unistd.h', define_name='HAVE_PATHCONF')
conf.check(function_name='dirfd', header_name=['sys/types.h', 'dirent.h'], define_name='HAVE_DIRFD')
conf.check(function_name='localtime_r', header_name=['time.h'], define_name='HAVE_LOCALTIME_R')
conf.check(function_name='gmtime_r', header_name=['time.h'], define_name='HAVE_GMTIME_R')
conf.sub_config('src/common')
conf.sub_config('src/angel')

Loading…
Cancel
Save