aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-03-21 11:27:37 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2016-03-21 11:30:59 -0700
commit711766dc7553734ab239519ba30d3ca165b24874 (patch)
treeacf4b762af11cb20d65210e4d69cf648bcddf931 /test
parentb08ee7a260d0f274554892cd3138215ab905ce77 (diff)
Ensure that no #includes are inside of a namespace.
Diffstat (limited to 'test')
-rw-r--r--test/cpp/qps/limit_cores.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/cpp/qps/limit_cores.cc b/test/cpp/qps/limit_cores.cc
index fad9a323af..c9931d9130 100644
--- a/test/cpp/qps/limit_cores.cc
+++ b/test/cpp/qps/limit_cores.cc
@@ -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