Merge pull request #489 from jtattermusch/cpu_windows

Added placeholder for cpu_windows.c implementation
pull/490/head
Nicolas Noble 10 years ago
commit 31f89f877d
  1. 2
      Makefile
  2. 1
      build.json
  3. 54
      src/core/support/cpu_windows.c
  4. 2
      vsprojects/vs2013/gpr.vcxproj
  5. 3
      vsprojects/vs2013/gpr.vcxproj.filters

@ -1684,6 +1684,7 @@ LIBGPR_SRC = \
src/core/support/cmdline.c \
src/core/support/cpu_linux.c \
src/core/support/cpu_posix.c \
src/core/support/cpu_windows.c \
src/core/support/env_linux.c \
src/core/support/env_posix.c \
src/core/support/env_win32.c \
@ -1776,6 +1777,7 @@ objs/$(CONFIG)/src/core/support/cancellable.o:
objs/$(CONFIG)/src/core/support/cmdline.o:
objs/$(CONFIG)/src/core/support/cpu_linux.o:
objs/$(CONFIG)/src/core/support/cpu_posix.o:
objs/$(CONFIG)/src/core/support/cpu_windows.o:
objs/$(CONFIG)/src/core/support/env_linux.o:
objs/$(CONFIG)/src/core/support/env_posix.o:
objs/$(CONFIG)/src/core/support/env_win32.o:

@ -252,6 +252,7 @@
"src/core/support/cmdline.c",
"src/core/support/cpu_linux.c",
"src/core/support/cpu_posix.c",
"src/core/support/cpu_windows.c",
"src/core/support/env_linux.c",
"src/core/support/env_posix.c",
"src/core/support/env_win32.c",

@ -0,0 +1,54 @@
/*
*
* Copyright 2014, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <grpc/support/port_platform.h>
#ifdef GPR_WIN32
#include "src/core/support/cpu.h"
#include <grpc/support/log.h>
unsigned gpr_cpu_num_cores(void) {
/* TODO(jtattermusch): implement */
gpr_log(GPR_ERROR, "Cannot determine number of CPUs: assuming 1");
return 1;
}
unsigned gpr_cpu_current_cpu(void) {
/* TODO(jtattermusch): implement */
gpr_log(GPR_ERROR, "Cannot determine current CPU");
return 0;
}
#endif /* GPR_WIN32 */

@ -120,6 +120,8 @@
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_windows.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_linux.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_posix.c">

@ -16,6 +16,9 @@
<ClCompile Include="..\..\src\core\support\cpu_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_windows.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_linux.c">
<Filter>src\core\support</Filter>
</ClCompile>

Loading…
Cancel
Save