Skip to content

Commit 3b527c5

Browse files
committed
Handle missing function declarations and undefined/divergence of function names in windows.
- Makefile: allow implicit functions warnings, define stricmp as macro for strcasecmp, define WIN32. - cc.h: check if BYTE_ORDER is not already defined (which is in windows toolchain) - socket.h: Check if timeval.h hasn't already been included before defining the timeval struct - Define __locale_c_type_ptr function, locale/ctype support is not enabled in windows toolchain.
1 parent 7128555 commit 3b527c5

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ ifeq ($(OS),Windows_NT)
100100
else
101101
# It is gcc, may be cygwin
102102
# Can we use -fdata-sections?
103-
CCFLAGS += -ffunction-sections -fno-jump-tables -fdata-sections -fpack-struct=4
103+
CCFLAGS += -ffunction-sections -fno-jump-tables -fdata-sections -fpack-struct=4 -Wno-error=implicit-function-declaration -Dstricmp=strcasecmp -DWIN32
104104
AR = xtensa-lx106-elf-ar
105105
CC = xtensa-lx106-elf-gcc
106106
CXX = xtensa-lx106-elf-g++

app/include/arch/cc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@
4242

4343
//#define LWIP_PROVIDE_ERRNO
4444

45+
#ifndef BYTE_ORDER
4546
#if (1)
4647
#define BYTE_ORDER LITTLE_ENDIAN
4748
#else
4849
#define BYTE_ORDER BIG_ENDIAN
4950
#endif
51+
#endif
5052

5153

5254
typedef uint8_t u8_t;

app/include/sys/socket.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,13 @@ typedef uint32 socklen_t;
242242
#define O_NDELAY 1 /* same as O_NONBLOCK, for compatibility */
243243
#endif
244244

245+
#ifndef _SYS__TIMEVAL_H_
245246
struct timeval {
246247
long tv_sec; /* seconds */
247248
long tv_usec; /* and microseconds */
248249
};
250+
#endif
251+
249252
/* Flags for struct netconn.flags (u8_t) */
250253
/** TCP: when data passed to netconn_write doesn't fit into the send buffer,
251254
this temporarily stores whether to wake up the original application task

app/libc/stdlib.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
#define TRUE 1
1111
#define FALSE 0
1212
#endif
13+
14+
#ifdef WIN32
15+
// locale/ctype support not enabled for windows
16+
__attribute__((weak))
17+
const char* __locale_ctype_ptr(void) {
18+
return NULL;
19+
}
20+
#endif
21+
1322
double powersOf10[] ICACHE_STORE_ATTR ICACHE_RODATA_ATTR = /* Table giving binary powers of 10. Entry */
1423
{
1524
10., /* is 10^2^i. Used to convert decimal */

0 commit comments

Comments
 (0)