From bee9037c464d3ba4c1ef0684daee8c1b11efbc9a Mon Sep 17 00:00:00 2001 From: maxiao Date: Mon, 10 Jun 2024 18:32:04 +0800 Subject: [PATCH] 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. --- portable/ThirdParty/GCC/Posix/port.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/portable/ThirdParty/GCC/Posix/port.c b/portable/ThirdParty/GCC/Posix/port.c index fdb556d045c..05f08cf7ca9 100644 --- a/portable/ThirdParty/GCC/Posix/port.c +++ b/portable/ThirdParty/GCC/Posix/port.c @@ -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 #include #include