Skip to content

Commit bee9037

Browse files
authored
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.
1 parent c431b35 commit bee9037

File tree

1 file changed

+2
-4
lines changed
  • portable/ThirdParty/GCC/Posix

1 file changed

+2
-4
lines changed

portable/ThirdParty/GCC/Posix/port.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@
4949
* only or serialized with a FreeRTOS primitive such as a binary
5050
* semaphore or mutex.
5151
*----------------------------------------------------------*/
52-
#include "portmacro.h"
53-
5452
#ifdef __linux__
55-
#define __USE_GNU
53+
#define _GNU_SOURCE
5654
#endif
57-
55+
#include "portmacro.h"
5856
#include <errno.h>
5957
#include <pthread.h>
6058
#include <limits.h>

0 commit comments

Comments
 (0)