newlib: fixes for compatibility with newlib 3.0

This commit is contained in:
Ivan Grokhotkov 2019-03-28 19:22:37 +08:00
parent 4770acf1cb
commit d15e18aa5d
4 changed files with 9 additions and 6 deletions

View file

@ -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 <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__

View 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";
}

View 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)

View 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))