diff mbox series

vxworks: Fix overzealous gthread support inhibition for vxworks

Message ID 85AB17D4-7ADD-47DD-971C-DBB7D3BC8819@adacore.com
State New
Headers show
Series vxworks: Fix overzealous gthread support inhibition for vxworks | expand

Commit Message

Olivier Hainque Oct. 23, 2020, 3:14 p.m. UTC
The tests for macros possibly defined in gthr.h needs to
be performed after the corresponding #include. This was tested
together with the previous updates to gthr-vxworks-thread.c
and gthr-vxworks-cond.c and was meant to be squashed with them.

Olivier
    
2010-10-23  Olivier Hainque  <hainque@adacore.com>
    
libgcc/
        * config/gthr-vxworks-thread.c: #include gthr.h before
        testing the guard defined there.
        * config/gthr-vxworks-cond.c: Likewise.
diff mbox series

Patch

--- a/libgcc/config/gthr-vxworks-cond.c
+++ b/libgcc/config/gthr-vxworks-cond.c
@@ -26,9 +26,10 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    This file implements the GTHREAD_HAS_COND part of the interface
    exposed by gthr-vxworks.h.  */
 
+#include "gthr.h"
+
 #if __GTHREAD_HAS_COND
 
-#include "gthr.h"
 #include <taskLib.h>
 
 /* --------------------------- Condition Variables ------------------------ */
diff --git a/libgcc/config/gthr-vxworks-thread.c b/libgcc/config/gthr-vxworks-thread.c
index a723005e03bc..c87168c22711 100644
--- a/libgcc/config/gthr-vxworks-thread.c
+++ b/libgcc/config/gthr-vxworks-thread.c
@@ -27,9 +27,10 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    exposed by gthr-vxworks.h, using APIs exposed by regular (!AE/653)
    VxWorks kernels.  */
 
+#include "gthr.h"
+
 #if __GTHREAD_CXX0X
 
-#include "gthr.h"
 #include <taskLib.h>
 #include <stdlib.h>