Commit 8ef5cd33 authored by 's avatar

Regenerate header files for VC++.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@34 eb4d4688-79bd-11dd-afb4-1d65580434c0
parent a82b66f2
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// Annoying stuff for windows -- makes sure clients can import these functions // Annoying stuff for windows -- makes sure clients can import these functions
#ifndef GOOGLE_GLOG_DLL_DECL #ifndef GOOGLE_GLOG_DLL_DECL
# ifdef _WIN32 # if defined(_WIN32) && !defined(__CYGWIN__)
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) # define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
# else # else
# define GOOGLE_GLOG_DLL_DECL # define GOOGLE_GLOG_DLL_DECL
......
This diff is collapsed.
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
// Copyright 2006 Google Inc. All Rights Reserved. // Copyright 2006 Google Inc. All Rights Reserved.
// Author: Maxim Lifantsev // Author: Maxim Lifantsev
// //
// Logging routines that do not allocate any memory and acquire any // Thread-safe logging routines that do not allocate any memory or
// locks, and can therefore be used by low-level memory allocation // acquire any locks, and can therefore be used by low-level memory
// and synchronization code. // allocation and synchronization code.
#ifndef BASE_RAW_LOGGING_H__ #ifndef BASE_RAW_LOGGING_H_
#define BASE_RAW_LOGGING_H__ #define BASE_RAW_LOGGING_H_
namespace google { namespace google {
...@@ -19,7 +19,7 @@ namespace google { ...@@ -19,7 +19,7 @@ namespace google {
// Annoying stuff for windows -- makes sure clients can import these functions // Annoying stuff for windows -- makes sure clients can import these functions
#ifndef GOOGLE_GLOG_DLL_DECL #ifndef GOOGLE_GLOG_DLL_DECL
# ifdef _WIN32 # if defined(_WIN32) && !defined(__CYGWIN__)
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) # define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
# else # else
# define GOOGLE_GLOG_DLL_DECL # define GOOGLE_GLOG_DLL_DECL
...@@ -42,26 +42,79 @@ namespace google { ...@@ -42,26 +42,79 @@ namespace google {
// I0821 211317 file.cc:142] RAW: status is 20 // I0821 211317 file.cc:142] RAW: status is 20
#define RAW_LOG(severity, ...) \ #define RAW_LOG(severity, ...) \
do { \ do { \
google::RawLog__(google::severity, __FILE__, __LINE__, __VA_ARGS__); \ switch (google::severity) { \
case 0: \
RAW_LOG_INFO(__VA_ARGS__); \
break; \
case 1: \
RAW_LOG_WARNING(__VA_ARGS__); \
break; \
case 2: \
RAW_LOG_ERROR(__VA_ARGS__); \
break; \
case 3: \
RAW_LOG_FATAL(__VA_ARGS__); \
break; \
default: \
break; \
} \
} while (0) } while (0)
// The following STRIP_LOG testing is performed in the header file so that it's
// possible to completely compile out the logging code and the log messages.
#if STRIP_LOG == 0
#define RAW_VLOG(verboselevel, ...) \ #define RAW_VLOG(verboselevel, ...) \
do { \ do { \
if (VLOG_IS_ON(verboselevel)) { \ if (VLOG_IS_ON(verboselevel)) { \
google::RawLog__(google::INFO, __FILE__, __LINE__, __VA_ARGS__); \ RAW_LOG_INFO(__VA_ARGS__); \
} \ } \
} while (0) } while (0)
#else
#define RAW_VLOG(verboselevel, ...) RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG == 0
#if STRIP_LOG == 0
#define RAW_LOG_INFO(...) google::RawLog__(google::INFO, \
__FILE__, __LINE__, __VA_ARGS__)
#else
#define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG == 0
#if STRIP_LOG <= 1
#define RAW_LOG_WARNING(...) google::RawLog__(google::WARNING, \
__FILE__, __LINE__, __VA_ARGS__)
#else
#define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 1
#if STRIP_LOG <= 2
#define RAW_LOG_ERROR(...) google::RawLog__(google::ERROR, \
__FILE__, __LINE__, __VA_ARGS__)
#else
#define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 2
#if STRIP_LOG <= 3
#define RAW_LOG_FATAL(...) google::RawLog__(google::FATAL, \
__FILE__, __LINE__, __VA_ARGS__)
#else
#define RAW_LOG_FATAL(...) \
do { \
google::RawLogStub__(0, __VA_ARGS__); \
exit(1); \
} while (0)
#endif // STRIP_LOG <= 3
// Similar to CHECK(condition) << message, // Similar to CHECK(condition) << message,
// but for low-level modules: we use only RAW_LOG that does not allocate memory. // but for low-level modules: we use only RAW_LOG that does not allocate memory.
// We do not want to provide args list here to encourage this usage: // We do not want to provide args list here to encourage this usage:
// if (!cond) RAW_LOG(FATAL, "foo ...", hard_to_compute_args); // if (!cond) RAW_LOG(FATAL, "foo ...", hard_to_compute_args);
// so that the args are not computed when not needed. // so that the args are not computed when not needed.
#define RAW_CHECK(condition, message) \ #define RAW_CHECK(condition, message) \
do { \ do { \
if (!(condition)) { \ if (!(condition)) { \
RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \ RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
} \ } \
} while (0) } while (0)
// Debug versions of RAW_LOG and RAW_CHECK // Debug versions of RAW_LOG and RAW_CHECK
...@@ -72,8 +125,8 @@ namespace google { ...@@ -72,8 +125,8 @@ namespace google {
#else // NDEBUG #else // NDEBUG
#define RAW_DLOG(severity, ...) \ #define RAW_DLOG(severity, ...) \
while (false) \ while (false) \
RAW_LOG(severity, __VA_ARGS__) RAW_LOG(severity, __VA_ARGS__)
#define RAW_DCHECK(condition, message) \ #define RAW_DCHECK(condition, message) \
while (false) \ while (false) \
...@@ -81,6 +134,11 @@ namespace google { ...@@ -81,6 +134,11 @@ namespace google {
#endif // NDEBUG #endif // NDEBUG
// Stub log function used to work around for unused variable warnings when
// building with STRIP_LOG > 0.
static inline void RawLogStub__(int ignored, ...) {
}
// Helper function to implement RAW_LOG and RAW_VLOG // Helper function to implement RAW_LOG and RAW_VLOG
// Logs format... at "severity" level, reporting it // Logs format... at "severity" level, reporting it
// as called from file:line. // as called from file:line.
...@@ -95,8 +153,8 @@ GOOGLE_GLOG_DLL_DECL void RawLog__(LogSeverity severity, ...@@ -95,8 +153,8 @@ GOOGLE_GLOG_DLL_DECL void RawLog__(LogSeverity severity,
// this module does not have to directly call localtime_r(), // this module does not have to directly call localtime_r(),
// which could allocate memory. // which could allocate memory.
extern "C" struct ::tm; extern "C" struct ::tm;
GOOGLE_GLOG_DLL_DECL void RawLog__SetLastTime(const struct ::tm& t); GOOGLE_GLOG_DLL_DECL void RawLog__SetLastTime(const struct ::tm& t, int usecs);
} }
#endif // BASE_RAW_LOGGING_H__ #endif // BASE_RAW_LOGGING_H_
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
// Annoying stuff for windows -- makes sure clients can import these functions // Annoying stuff for windows -- makes sure clients can import these functions
#ifndef GOOGLE_GLOG_DLL_DECL #ifndef GOOGLE_GLOG_DLL_DECL
# ifdef _WIN32 # if defined(_WIN32) && !defined(__CYGWIN__)
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) # define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
# else # else
# define GOOGLE_GLOG_DLL_DECL # define GOOGLE_GLOG_DLL_DECL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment