Cycles: Fix compilation error when building without Glog and no C++11
This commit is contained in:
parent
4d124418b7
commit
58c456b12d
|
@ -19,28 +19,28 @@
|
|||
|
||||
#if defined(WITH_CYCLES_LOGGING) && !defined(__KERNEL_GPU__)
|
||||
# include <glog/logging.h>
|
||||
#else
|
||||
# include <iostream>
|
||||
#endif
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
#if !defined(WITH_CYCLES_LOGGING) || defined(__KERNEL_GPU__)
|
||||
class StubStream : public std::ostream {
|
||||
public:
|
||||
StubStream() : std::ostream(NULL) { }
|
||||
class StubStream {
|
||||
public:
|
||||
template<class T>
|
||||
StubStream& operator<<(const T&) {
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
class LogMessageVoidify {
|
||||
public:
|
||||
LogMessageVoidify() { }
|
||||
void operator&(::std::ostream&) { }
|
||||
void operator&(StubStream&) { }
|
||||
};
|
||||
|
||||
# define LOG_SUPPRESS() (true) ? (void) 0 : LogMessageVoidify() & StubStream()
|
||||
# define LOG(severity) LOG_SUPPRESS()
|
||||
# define VLOG(severity) LOG_SUPPRESS()
|
||||
|
||||
#endif
|
||||
|
||||
#define VLOG_ONCE(level, flag) if(!flag) flag = true, VLOG(level)
|
||||
|
|
Loading…
Reference in New Issue