Merge branch 'master' into loaded

pull/5240/head
Vijay Pai 9 years ago
commit 6c998da4bf
  1. 1
      src/csharp/Grpc.Core/Grpc.Core.csproj
  2. 122
      src/csharp/Grpc.Core/Logging/NullLogger.cs
  3. 8
      src/python/grpcio/grpc/_cython/imports.generated.c
  4. 8
      src/python/grpcio/grpc/_cython/imports.generated.h
  5. 11
      src/python/grpcio/grpc/_cython/loader.c
  6. 9
      src/python/grpcio/grpc/_cython/loader.h
  7. 9
      templates/src/python/grpcio/grpc/_cython/imports.generated.c.template
  8. 8
      templates/src/python/grpcio/grpc/_cython/imports.generated.h.template

@ -59,6 +59,7 @@
<Compile Include="IServerStreamWriter.cs" />
<Compile Include="IAsyncStreamWriter.cs" />
<Compile Include="IAsyncStreamReader.cs" />
<Compile Include="Logging\NullLogger.cs" />
<Compile Include="ServerPort.cs" />
<Compile Include="Version.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

@ -0,0 +1,122 @@
#region Copyright notice and license
// Copyright 2016, 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.
#endregion
using System;
namespace Grpc.Core.Logging
{
/// <summary>
/// Logger which doesn't log any information anywhere.
/// </summary>
public sealed class NullLogger : ILogger
{
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Debug(string message)
{
}
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Debug(string format, params object[] formatArgs)
{
}
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Error(string message)
{
}
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Error(Exception exception, string message)
{
}
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Error(string format, params object[] formatArgs)
{
}
/// <summary>
/// Returns a reference to the instance on which the method is called, as
/// instances aren't associated with specific types.
/// </summary>
public ILogger ForType<T>()
{
return this;
}
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Info(string message)
{
}
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Info(string format, params object[] formatArgs)
{
}
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Warning(string message)
{
}
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Warning(Exception exception, string message)
{
}
/// <summary>
/// As with all logging calls on this logger, this method is a no-op.
/// </summary>
public void Warning(string format, params object[] formatArgs)
{
}
}
}

@ -296,6 +296,10 @@ gpr_thd_options_is_joinable_type gpr_thd_options_is_joinable_import;
gpr_thd_currentid_type gpr_thd_currentid_import;
gpr_thd_join_type gpr_thd_join_import;
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
void pygrpc_load_imports(HMODULE library) {
census_initialize_import = (census_initialize_type) GetProcAddress(library, "census_initialize");
census_shutdown_import = (census_shutdown_type) GetProcAddress(library, "census_shutdown");
@ -557,4 +561,8 @@ void pygrpc_load_imports(HMODULE library) {
gpr_thd_join_import = (gpr_thd_join_type) GetProcAddress(library, "gpr_thd_join");
}
#ifdef __cplusplus
}
#endif /* __cpluslus */
#endif /* !GPR_WIN32 */

@ -836,8 +836,16 @@ typedef void(*gpr_thd_join_type)(gpr_thd_id t);
extern gpr_thd_join_type gpr_thd_join_import;
#define gpr_thd_join gpr_thd_join_import
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
void pygrpc_load_imports(HMODULE library);
#ifdef __cplusplus
}
#endif /* __cpluslus */
#else /* !GPR_WIN32 */
#include <grpc/support/alloc.h>

@ -33,6 +33,10 @@
#include "loader.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
#if GPR_WIN32
int pygrpc_load_core(char *path) {
@ -56,4 +60,9 @@ int pygrpc_load_core(char *path) {
int pygrpc_load_core(char *path) { return 1; }
#endif
#endif /* !GPR_WIN32 */
#ifdef __cplusplus
}
#endif /* __cpluslus */

@ -39,7 +39,16 @@
/* Additional inclusions not covered by "imports.generated.h" */
#include <grpc/byte_buffer_reader.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
/* Attempts to load the core if necessary, and return non-zero upon succes. */
int pygrpc_load_core(char *path);
#ifdef __cplusplus
}
#endif /* __cpluslus */
#endif /* GRPC_RB_BYTE_BUFFER_H_ */

@ -43,10 +43,19 @@
${api.name}_type ${api.name}_import;
%endfor
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
void pygrpc_load_imports(HMODULE library) {
%for api in c_apis:
${api.name}_import = (${api.name}_type) GetProcAddress(library, "${api.name}");
%endfor
}
#ifdef __cplusplus
}
#endif /* __cpluslus */
#endif /* !GPR_WIN32 */

@ -52,8 +52,16 @@
#define ${api.name} ${api.name}_import
%endfor
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
void pygrpc_load_imports(HMODULE library);
#ifdef __cplusplus
}
#endif /* __cpluslus */
#else /* !GPR_WIN32 */
#include <grpc/support/alloc.h>

Loading…
Cancel
Save