diff options
author | William Speirs <bill.speirs@gmail.com> | 2014-10-14 17:07:30 -0400 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-10-15 00:48:59 +0200 |
commit | 0352dbfd65072f42824852b2f5b925e7d9865a90 (patch) | |
tree | 6de3dfc255ce82f624eadca9206cb1e760784896 /kernel/log.h | |
parent | fad0b0c506f2d7cb1158a3dac53139b8dec7a04e (diff) |
Fixed log so it will compile under Visual Studio
- Included an implementation of gettimeofday
Diffstat (limited to 'kernel/log.h')
-rw-r--r-- | kernel/log.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/kernel/log.h b/kernel/log.h index b4182b5f..d4b21110 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -23,10 +23,10 @@ #define LOG_H #include <time.h> -#include <sys/time.h> #ifndef _WIN32 -# include <sys/resource.h> + #include <sys/time.h> + #include <sys/resource.h> #endif // from libs/sha1/sha1.h @@ -51,12 +51,20 @@ extern int log_verbose_level; void logv(const char *format, va_list ap); void logv_header(const char *format, va_list ap); -void logv_error(const char *format, va_list ap) __attribute__ ((noreturn)); -void log(const char *format, ...) __attribute__ ((format (printf, 1, 2))); -void log_header(const char *format, ...) __attribute__ ((format (printf, 1, 2))); -void log_error(const char *format, ...) __attribute__ ((format (printf, 1, 2))) __attribute__ ((noreturn)); -void log_cmd_error(const char *format, ...) __attribute__ ((format (printf, 1, 2))) __attribute__ ((noreturn)); +#if !defined(__GNUC__) && !defined(__clang__) + void logv_error(const char *format, va_list ap); + void log(const char *format, ...); + void log_header(const char *format, ...); + void log_error(const char *format, ...); + void log_cmd_error(const char *format, ...); +#else + void logv_error(const char *format, va_list ap) __attribute__((noreturn)); + void log(const char *format, ...) __attribute__((format(printf, 1, 2))); + void log_header(const char *format, ...) __attribute__((format(printf, 1, 2))); + void log_error(const char *format, ...) __attribute__((format(printf, 1, 2))) __attribute__((noreturn)); + void log_cmd_error(const char *format, ...) __attribute__((format(printf, 1, 2))) __attribute__((noreturn)); +#endif void log_spacer(); void log_push(); |