From: Ivan Grokhotkov Date: Thu, 28 Mar 2019 11:22:37 +0000 (+0800) Subject: newlib: fixes for compatibility with newlib 3.0 X-Git-Tag: v4.0-beta1~419^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d15e18aa5db53f55344bbb4a7623d3dd46b6ad0f;p=esp-idf newlib: fixes for compatibility with newlib 3.0 --- diff --git a/components/newlib/platform_include/sys/select.h b/components/newlib/platform_include/sys/select.h index 199d48144d..ca7e4a4a28 100644 --- a/components/newlib/platform_include/sys/select.h +++ b/components/newlib/platform_include/sys/select.h @@ -15,7 +15,11 @@ #ifndef __ESP_SYS_SELECT_H__ #define __ESP_SYS_SELECT_H__ +/* Newlib 2.2.0 does not provide sys/select.h, and fd_set is defined in sys/types.h */ #include +#ifndef fd_set +#include_next +#else // fd_set #include #ifdef __cplusplus @@ -28,4 +32,6 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct } // extern "C" #endif +#endif // fd_set + #endif //__ESP_SYS_SELECT_H__ diff --git a/components/newlib/reent_init.c b/components/newlib/reent_init.c index 5c29e898c6..638d10be29 100644 --- a/components/newlib/reent_init.c +++ b/components/newlib/reent_init.c @@ -41,5 +41,4 @@ void IRAM_ATTR esp_reent_init(struct _reent* r) r->__sglue._next = NULL; r->__sglue._niobs = 0; r->__sglue._iobs = NULL; - r->_current_locale = "C"; } diff --git a/components/pthread/pthread.c b/components/pthread/pthread.c index 99e5d209e2..2bdfb3b72b 100644 --- a/components/pthread/pthread.c +++ b/components/pthread/pthread.c @@ -460,7 +460,8 @@ void pthread_exit(void *value_ptr) vTaskSuspend(NULL); } - ESP_LOGV(TAG, "%s EXIT", __FUNCTION__); + // Should never be reached + abort(); } int pthread_cancel(pthread_t thread) diff --git a/components/wpa_supplicant/port/include/endian.h b/components/wpa_supplicant/port/include/endian.h index f84f923cab..0d0d4f5ba4 100644 --- a/components/wpa_supplicant/port/include/endian.h +++ b/components/wpa_supplicant/port/include/endian.h @@ -83,10 +83,7 @@ typedef __uint64_t uint64_t; * Host to big endian, host to little endian, big endian to host, and little * endian to host byte order functions as detailed in byteorder(9). */ -#if 1 //BYTE_ORDER == _LITTLE_ENDIAN -#define __bswap16 __bswap_16 -#define __bswap32 __bswap_32 -#define __bswap64 __bswap_64 +#if BYTE_ORDER == _LITTLE_ENDIAN #define htobe16(x) bswap16((x)) #define htobe32(x) bswap32((x)) #define htobe64(x) bswap64((x))