]> granicus.if.org Git - esp-idf/commitdiff
newlib: fixes for compatibility with newlib 3.0
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 28 Mar 2019 11:22:37 +0000 (19:22 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Wed, 10 Apr 2019 05:48:57 +0000 (13:48 +0800)
components/newlib/platform_include/sys/select.h
components/newlib/reent_init.c
components/pthread/pthread.c
components/wpa_supplicant/port/include/endian.h

index 199d48144d372cc654652cacd06df920c597d554..ca7e4a4a28fe6f4c413ff935d96e308064715388 100644 (file)
 #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 <sys/types.h>
+#ifndef fd_set
+#include_next <sys/select.h>
+#else // fd_set
 #include <sys/time.h>
 
 #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__
index 5c29e898c608dcf4ce84cc82a64d82dcdc1a0263..638d10be29da6950e436207b0835dc29bed962e5 100644 (file)
@@ -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";
 }
index 99e5d209e2bcd3ac41685924920a9707c81ced05..2bdfb3b72bcb9dfc39f5c59a457dafeac457beb9 100644 (file)
@@ -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)
index f84f923cabddec9cbf3738432cd804f26785da05..0d0d4f5ba48b33fdf234d90244590c6e141f1d2c 100644 (file)
@@ -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))