Windows:sys/time.h: Correct sys/time.h errors

Summary:
The way sys/time.h was added it was not being compiled in the right way.
PR#16 makes possible to compile unposix/sys, so it was possible to
detect some errors.
The errors were about fault includes.
Now there should be no compile errors at sys/time.h.

Depends on PR#16

Test Plan:
- comment -Wno-missing-variable-declarations at meson.build;
- added -k0 to NINJAFLAGS at build.bat;
- there should not be any errors/warnings about sys/types.h.
This commit is contained in:
Lucas Cavalcante de Sousa 2020-03-26 12:09:38 -03:00 committed by João Paulo Taylor Ienczak Zanette
parent 135415bac7
commit f06c1747dd
2 changed files with 9 additions and 8 deletions

View File

@ -25,4 +25,3 @@ struct tm *localtime_r(const time_t * time, struct tm * result)
localtime_s(result, time);
return result;
}

View File

@ -1,11 +1,17 @@
#ifndef SYS_TIME_H
#define SYS_TIME_H
#ifndef UNPOSIX_SYS_TIME_H
#define UNPOSIX_SYS_TIME_H
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
// Windows Kit for Windows 10 already defines `struct timeval` and `time_t`
#include <windows.h>
#include <winsock2.h>
#include <minwinbase.h>
#include <sysinfoapi.h>
#include <timezoneapi.h>
#include <stdint.h>
#include <time.h>
typedef unsigned short u_short;
@ -15,10 +21,6 @@ struct timezone {
int tz_dsttime; /* type of DST correction */
};
typedef long suseconds_t;
typedef struct timeval timeval;
int gettimeofday(struct timeval * tp, struct timezone * tzp);
struct tm *localtime_r(const time_t * time, struct tm * result);