| Index: third_party/grpc/src/core/support/log.c
|
| diff --git a/third_party/WebKit/Source/build/win/Precompile.h b/third_party/grpc/src/core/support/log.c
|
| similarity index 63%
|
| copy from third_party/WebKit/Source/build/win/Precompile.h
|
| copy to third_party/grpc/src/core/support/log.c
|
| index 8a0ff29c353fc1d30c92d27f369d7c422a579bc8..04156a5b1fc092094f29c82426feb9c57df1d565 100644
|
| --- a/third_party/WebKit/Source/build/win/Precompile.h
|
| +++ b/third_party/grpc/src/core/support/log.c
|
| @@ -1,5 +1,7 @@
|
| /*
|
| - * Copyright (C) 2012 Google Inc. All rights reserved.
|
| + *
|
| + * Copyright 2015, 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
|
| @@ -26,43 +28,39 @@
|
| * 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.
|
| - */
|
| -
|
| -/*
|
| - * Precompiled header for WebKit when built on Windows using
|
| - * GYP-generated project files. Not used by other build
|
| - * configurations.
|
| *
|
| - * Using precompiled headers speeds the build up significantly. On a
|
| - * fast machine (HP Z600, 12 GB of RAM), an ~18% decrease in full
|
| - * build time was measured.
|
| */
|
|
|
| -#if defined(WinPrecompile_h_)
|
| -#error You shouldn't include the precompiled header file more than once.
|
| -#endif
|
| +#include <grpc/support/log.h>
|
| +#include <grpc/support/port_platform.h>
|
|
|
| -#define WinPrecompile_h_
|
| +#include <stdio.h>
|
| +#include <string.h>
|
|
|
| -#define _USE_MATH_DEFINES // Make math.h behave like other platforms.
|
| +extern void gpr_default_log(gpr_log_func_args *args);
|
| +static gpr_log_func g_log_func = gpr_default_log;
|
|
|
| -#include <Windows.h>
|
| +const char *gpr_log_severity_string(gpr_log_severity severity) {
|
| + switch (severity) {
|
| + case GPR_LOG_SEVERITY_DEBUG:
|
| + return "D";
|
| + case GPR_LOG_SEVERITY_INFO:
|
| + return "I";
|
| + case GPR_LOG_SEVERITY_ERROR:
|
| + return "E";
|
| + }
|
| + GPR_UNREACHABLE_CODE(return "UNKNOWN");
|
| +}
|
|
|
| -#include <errno.h>
|
| -#include <fcntl.h>
|
| -#include <limits.h>
|
| -#include <math.h>
|
| -#include <stdarg.h>
|
| -#include <stddef.h>
|
| -#include <stdio.h>
|
| -#include <stdlib.h>
|
| -#include <string.h>
|
| -#include <time.h>
|
| +void gpr_log_message(const char *file, int line, gpr_log_severity severity,
|
| + const char *message) {
|
| + gpr_log_func_args lfargs;
|
| + memset(&lfargs, 0, sizeof(lfargs));
|
| + lfargs.file = file;
|
| + lfargs.line = line;
|
| + lfargs.severity = severity;
|
| + lfargs.message = message;
|
| + g_log_func(&lfargs);
|
| +}
|
|
|
| -#include <algorithm>
|
| -#include <ciso646>
|
| -#include <cmath>
|
| -#include <cstddef>
|
| -#include <limits>
|
| -#include <string>
|
| -#include <utility>
|
| +void gpr_set_log_function(gpr_log_func f) { g_log_func = f; }
|
|
|