Not only comment it out but removing it
[midnight-commander.git] / src / timefmt.h
blob2b8d52fd8c36d7dd4466e9b1b070701b12ff12ce
1 #ifndef __UTIL_TIMEFMT_H
2 #define __UTIL_TIMEFMT_H
4 #include <sys/types.h>
6 #define INVALID_TIME_TEXT "(invalid)"
8 #ifdef HAVE_STRFTIME
10 /* safe localtime formatting - strftime()-using version */
11 #define FMT_LOCALTIME(buffer, bufsize, fmt, when) \
12 { \
13 struct tm *whentm; \
14 whentm = localtime(&when); \
15 if (whentm == NULL) \
16 { \
17 strncpy(buffer, INVALID_TIME_TEXT, bufsize); \
18 buffer[bufsize-1] = 0; \
19 } \
20 else \
21 { \
22 strftime(buffer, bufsize, fmt, whentm); \
23 } \
24 } \
26 #else
28 /* fallback when strftime/localtime not available */
29 #define FMT_LOCALTIME(buffer,bufsize,fmt,when) \
30 { \
31 ctime_r(when,buffer); \
32 } \
34 #endif
36 #define FMT_LOCALTIME_CURRENT(buffer, bufsize, fmt) \
37 { \
38 time_t __current_time; \
39 time(&__current_time); \
40 FMT_LOCALTIME(buffer,bufsize,fmt,__current_time); \
43 #endif /* !__UTIL_H */