Move _GNU_SOURCE to gmxpre.h
[alexxy/gromacs.git] / src / gromacs / gmxlib / gmx_thread_affinity.c
index 385856f71ddef3c5bdc01760f4c0f62b76b1fc0f..75e277999be1fcef991d5d14a30d2456a8449214 100644 (file)
  */
 #include "gmxpre.h"
 
+#include "gromacs/legacyheaders/gmx_thread_affinity.h"
+
 #include "config.h"
-#if defined(HAVE_SCHED_H)
-#  ifndef _GNU_SOURCE
-#    define _GNU_SOURCE 1
-#  endif
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef HAVE_SCHED_AFFINITY
 #  include <sched.h>
 #  include <sys/syscall.h>
 #endif
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-#include <stdio.h>
 
 #include "thread_mpi/threads.h"
 
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/legacyheaders/types/commrec.h"
-#include "gromacs/legacyheaders/types/hw_info.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/gmx_cpuid.h"
 #include "gromacs/legacyheaders/gmx_omp_nthreads.h"
 #include "gromacs/legacyheaders/md_logging.h"
-#include "gromacs/legacyheaders/gmx_thread_affinity.h"
-
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/hw_info.h"
 #include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"