Have cpu_linux.c define _GNU_SOURCE at the beginning of the file

Feature test macros need to be defined before including any other
headers.
pull/380/head
David Klempner 10 years ago
parent f279362d0c
commit d44f8410df
  1. 33
      src/core/support/cpu_linux.c

@ -31,44 +31,15 @@
*
*/
#define _GNU_SOURCE
#include <grpc/support/port_platform.h>
#ifdef GPR_CPU_LINUX
#include "src/core/support/cpu.h"
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#define GRPC_GNU_SOURCE
#endif
#ifndef __USE_GNU
#define __USE_GNU
#define GRPC_USE_GNU
#endif
#ifndef __USE_MISC
#define __USE_MISC
#define GRPC_USE_MISC
#endif
#include <sched.h>
#ifdef GRPC_GNU_SOURCE
#undef _GNU_SOURCE
#undef GRPC_GNU_SOURCE
#endif
#ifdef GRPC_USE_GNU
#undef __USE_GNU
#undef GRPC_USE_GNU
#endif
#ifdef GRPC_USE_MISC
#undef __USE_MISC
#undef GRPC_USE_MISC
#endif
#include <errno.h>
#include <unistd.h>
#include <string.h>

Loading…
Cancel
Save