major restructuring, prepare for smp
This commit is contained in:
1 parent
b3569a2b90
commit
6bff37746d
229 files changed
+1617
-1489
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