add lwIP TCP/IP stack as a runtime driver, native socket syscalls, SysGetMemoryStatus replacing CatchAllDebugBucket, fix timeGetTime to return milliseconds, fix SysSleep to interpret argument as milliseconds, SysGetTick now returns microseconds, harden all syscalls against bad user pointers with CopyFromUser/CopyToUser/MmProbeUser throughout, add networking test apps, port-forward 8080 in runa.bat, split LWIP_DRIVER_CFLAGS, add settings.ini to deploy, remove ethernet.c stub
This commit is contained in:
1 parent
18b4dd0f61
commit
df13b8056c
365 files changed
+143263
-1362
No files matched your search
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#ifndef LWIP_PORT_STDLIB_H
|
||||
#define LWIP_PORT_STDLIB_H
|
||||
|
||||
/*
|
||||
* Minimal freestanding stdlib shim for lwIP.
|
||||
*
|
||||
* lwIP 2.2.1 includes <stdlib.h> in a couple of files only for atoi(). If MSVC
|
||||
* finds the UCRT header, it drags errno.h into the kernel build and then lwIP's
|
||||
* own errno values collide with UCRT's. Put this header first in lwIP's include
|
||||
* path so those sources stay freestanding.
|
||||
*/
|
||||
static __inline int atoi(const char* s) {
|
||||
int sign = 1;
|
||||
int value = 0;
|
||||
|
||||
if (!s)
|
||||
return 0;
|
||||
|
||||
while (*s == ' ' || *s == '\t' || *s == '\n' || *s == '\r' || *s == '\v' || *s == '\f')
|
||||
++s;
|
||||
|
||||
if (*s == '-') {
|
||||
sign = -1;
|
||||
++s;
|
||||
} else if (*s == '+') {
|
||||
++s;
|
||||
}
|
||||
|
||||
while (*s >= '0' && *s <= '9') {
|
||||
value = value * 10 + (*s - '0');
|
||||
++s;
|
||||
}
|
||||
|
||||
return sign * value;
|
||||
}
|
||||
|
||||
#endif /* LWIP_PORT_STDLIB_H */
|
||||
Reference in new issue
Block a user