Skip to content

Commit

Permalink
Fix compilation warning about undelcared pthread_setname_np (#1079)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maxiaogood authored Jun 10, 2024
1 parent c431b35 commit bee9037
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions portable/ThirdParty/GCC/Posix/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit bee9037

Please sign in to comment.