Fix compilation warning about undelcared pthread_setname_np (#1079)

Use _GNU_SOURCE macro instead of __USE_GNU and define it before
including portmacro.h. The reason is that portmacro.h includes limits.h
which in-turn includes features.h - this results in __USE_GNU getting
incorrectly undefined.
This commit is contained in:
maxiao
2024-06-10 18:32:04 +08:00
committed by GitHub
parent c431b358c8
commit bee9037c46

View File

@ -49,12 +49,10 @@
* only or serialized with a FreeRTOS primitive such as a binary
* semaphore or mutex.
*----------------------------------------------------------*/
#include "portmacro.h"
#ifdef __linux__
#define __USE_GNU
#define _GNU_SOURCE
#endif
#include "portmacro.h"
#include <errno.h>
#include <pthread.h>
#include <limits.h>