浏览代码

Protect inclusion of <sys/time.h>
by ifdef.
Declare time() if HAVE_DECL_TIME is 0

Sergey Poznyakoff 21 年之前
父节点
当前提交
2a384c4a84
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/system.h

+ 4 - 2
src/system.h

@@ -476,8 +476,10 @@ char *getenv ();
 #endif
 #endif
 
 
 #include <time.h>
 #include <time.h>
-#include <sys/time.h>
-#ifndef time
+#if defined(HAVE_SYS_TIME_H) && defined(TIME_WITH_SYS_TIME)
+# include <sys/time.h>
+#endif
+#if ! HAVE_DECL_TIME
 time_t time ();
 time_t time ();
 #endif
 #endif