初始化版本
This commit is contained in:
1
lwip/lwip-2.2.1/contrib/ports/win32/check/check_stdint.h
Normal file
1
lwip/lwip-2.2.1/contrib/ports/win32/check/check_stdint.h
Normal file
@ -0,0 +1 @@
|
||||
/* deliberateliy empty */
|
||||
29
lwip/lwip-2.2.1/contrib/ports/win32/check/config.h
Normal file
29
lwip/lwip-2.2.1/contrib/ports/win32/check/config.h
Normal file
@ -0,0 +1,29 @@
|
||||
/* config.h for check-0.11.0 on win32 under MSVC/MinGW */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
typedef unsigned int pid_t;
|
||||
typedef unsigned int uint32_t;
|
||||
|
||||
typedef int ssize_t;
|
||||
|
||||
#define HAVE_DECL_STRDUP 1
|
||||
#define HAVE_DECL_FILENO 1
|
||||
#define HAVE_DECL_PUTENV 1
|
||||
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
||||
/* disable some warnings */
|
||||
#pragma warning (disable: 4090) /* const assigned to non-const */
|
||||
#pragma warning (disable: 4996) /* fileno is deprecated */
|
||||
|
||||
#endif /* _ MSC_VER */
|
||||
|
||||
|
||||
#define LWIP_UNITTESTS_NOFORK
|
||||
|
||||
#include <io.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef unsigned int clockid_t;
|
||||
typedef unsigned int timer_t;
|
||||
9
lwip/lwip-2.2.1/contrib/ports/win32/check/stdbool.h
Normal file
9
lwip/lwip-2.2.1/contrib/ports/win32/check/stdbool.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef MY_STDBOOL_H
|
||||
#define MY_STDBOOL_H
|
||||
|
||||
typedef int bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#endif
|
||||
12
lwip/lwip-2.2.1/contrib/ports/win32/check/sys/time.h
Normal file
12
lwip/lwip-2.2.1/contrib/ports/win32/check/sys/time.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef LWIP_SYS__TIME_H
|
||||
#define LWIP_SYS__TIME_H
|
||||
|
||||
#include <stdlib.h> /* time_t */
|
||||
|
||||
struct timeval {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_usec; /* and microseconds */
|
||||
};
|
||||
int gettimeofday(struct timeval* tp, void* tzp);
|
||||
|
||||
#endif
|
||||
66
lwip/lwip-2.2.1/contrib/ports/win32/check/time.c
Normal file
66
lwip/lwip-2.2.1/contrib/ports/win32/check/time.c
Normal file
@ -0,0 +1,66 @@
|
||||
#include <time.h>
|
||||
|
||||
#include <windows.h>
|
||||
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
|
||||
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
|
||||
#else
|
||||
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
||||
struct timezone
|
||||
{
|
||||
int tz_minuteswest; /* minutes W of Greenwich */
|
||||
int tz_dsttime; /* type of dst correction */
|
||||
};
|
||||
|
||||
int gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
FILETIME ft;
|
||||
unsigned __int64 tmpres = 0;
|
||||
static int tzflag;
|
||||
|
||||
if (NULL != tv) {
|
||||
GetSystemTimeAsFileTime(&ft);
|
||||
|
||||
tmpres |= ft.dwHighDateTime;
|
||||
tmpres <<= 32;
|
||||
tmpres |= ft.dwLowDateTime;
|
||||
|
||||
/*converting file time to unix epoch*/
|
||||
tmpres -= DELTA_EPOCH_IN_MICROSECS;
|
||||
tmpres /= 10; /*convert into microseconds*/
|
||||
tv->tv_sec = (long)(tmpres / 1000000UL);
|
||||
tv->tv_usec = (long)(tmpres % 1000000UL);
|
||||
}
|
||||
|
||||
if (NULL != tz) {
|
||||
if (!tzflag) {
|
||||
_tzset();
|
||||
tzflag++;
|
||||
}
|
||||
tz->tz_minuteswest = _timezone / 60;
|
||||
tz->tz_dsttime = _daylight;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct tm *
|
||||
localtime_r(const time_t *timer, struct tm *result)
|
||||
{
|
||||
struct tm *local_result;
|
||||
|
||||
if (result == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
local_result = localtime (timer);
|
||||
if (local_result == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(result, local_result, sizeof(*result));
|
||||
return result;
|
||||
}
|
||||
7
lwip/lwip-2.2.1/contrib/ports/win32/check/unistd.h
Normal file
7
lwip/lwip-2.2.1/contrib/ports/win32/check/unistd.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef LWIP_UNISTD_H
|
||||
#define LWIP_UNISTD_H
|
||||
|
||||
/* include io.h for read() and write() */
|
||||
#include <io.h>
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user