| Index: third_party/android_crazy_linker/src/src/crazy_linker_debug.h
|
| diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_debug.h b/third_party/android_crazy_linker/src/src/crazy_linker_debug.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..934dfe6afd2620ec1e54436991b77b51c41f7c69
|
| --- /dev/null
|
| +++ b/third_party/android_crazy_linker/src/src/crazy_linker_debug.h
|
| @@ -0,0 +1,49 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CRAZY_LINKER_DEBUG_H
|
| +#define CRAZY_LINKER_DEBUG_H
|
| +
|
| +// Set CRAZY_DEBUG on the command-line to 1 to enable debugging support.
|
| +// This really means adding traces that will be sent to both stderr
|
| +// and the logcat during execution.
|
| +#undef CRAZY_DEBUG // TODO(simonb): Unhack me later.
|
| +#define CRAZY_DEBUG 1 // TODO(simonb): Unhack me later.
|
| +#ifndef CRAZY_DEBUG
|
| +#define CRAZY_DEBUG 0
|
| +#endif
|
| +
|
| +namespace crazy {
|
| +
|
| +#if CRAZY_DEBUG
|
| +
|
| +void Log(const char* fmt, ...);
|
| +void LogErrno(const char* fmt, ...);
|
| +
|
| +#define LOG(...) ::crazy::Log(__VA_ARGS__)
|
| +#define LOG_ERRNO(...) ::crazy::LogErrno(__VA_ARGS__)
|
| +
|
| +#else
|
| +
|
| +#define LOG(...) ((void)0)
|
| +#define LOG_ERRNO(...) ((void)0)
|
| +
|
| +#endif
|
| +
|
| +// Conditional logging.
|
| +#define LOG_IF(cond, ...) \
|
| + do { \
|
| + if ((cond)) \
|
| + LOG(__VA_ARGS__); \
|
| + } while (0)
|
| +
|
| +#define LOG_ERRNO_IF(cond, ...) \
|
| + do { \
|
| + if ((cond)) \
|
| + LOG_ERRNO(__VA_ARGS__); \
|
| + } while (0)
|
| +
|
| +} // namespace crazy
|
| +
|
| +#endif // CRAZY_LINKER_DEBUG_H
|
|
|