初始化版本

This commit is contained in:
冯佳
2026-02-09 10:27:21 +08:00
commit 64d767932f
4467 changed files with 2486822 additions and 0 deletions

View File

@ -0,0 +1 @@
/* deliberateliy empty */

View 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;

View 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

View 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

View 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;
}

View File

@ -0,0 +1,7 @@
#ifndef LWIP_UNISTD_H
#define LWIP_UNISTD_H
/* include io.h for read() and write() */
#include <io.h>
#endif