Skip to content
Snippets Groups Projects
Commit 711766dc authored by David Garcia Quintas's avatar David Garcia Quintas
Browse files

Ensure that no #includes are inside of a namespace.

parent b08ee7a2
No related branches found
No related tags found
No related merge requests found
......@@ -37,14 +37,15 @@
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
namespace grpc {
namespace testing {
#ifdef GPR_CPU_LINUX
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
namespace grpc {
namespace testing {
int LimitCores(const int* cores, int cores_size) {
const int num_cores = gpr_cpu_num_cores();
int cores_set = 0;
......@@ -72,6 +73,10 @@ int LimitCores(const int* cores, int cores_size) {
return cores_set;
}
#else
namespace grpc {
namespace testing {
// LimitCores is not currently supported for non-Linux platforms
int LimitCores(const int*, int) { return gpr_cpu_num_cores(); }
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment