Skip to content
Snippets Groups Projects
Commit 662d6a17 authored by Richard Linden's avatar Richard Linden
Browse files

added compile time warnings to use of deprecated llinfos, llwarns, etc.

parent cf014375
No related branches found
No related tags found
No related merge requests found
......@@ -355,13 +355,13 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
#define LL_INFOS_ONCE(...) lllog(LLError::LEVEL_INFO, true, ##__VA_ARGS__)
#define LL_WARNS_ONCE(...) lllog(LLError::LEVEL_WARN, true, ##__VA_ARGS__)
// DEPRECATED: Use the new macros that allow tags and *look* like macros.
//#define lldebugs LL_DEBUGS()
#define llinfos LL_INFOS()
//#define llwarns LL_WARNS()
//#define llerrs LL_ERRS()
//#define llcont LL_CONT
#define llendl LL_ENDL
#define lldebugs LL_COMPILE_TIME_WARNING("Warning: lldebugs deprecated, use LL_DEBUGS() instead"); LL_DEBUGS()
#define llinfos LL_COMPILE_TIME_WARNING("Warning: llinfos deprecated, use LL_INFOS() instead"); LL_INFOS()
#define llwarns LL_COMPILE_TIME_WARNING("Warning: llwarns deprecated, use LL_WARNS() instead"); LL_WARNS()
#define llerrs LL_COMPILE_TIME_WARNING("Warning: llerrs deprecated, use LL_ERRS() instead"); LL_ERRS()
#define llcont LL_COMPILE_TIME_WARNING("Warning: llcont deprecated, use LL_CONT instead"); LL_CONT
#define llendl LL_COMPILE_TIME_WARNING("Warning: llendl deprecated, use LL_ENDL instead"); LL_ENDL
#endif // LL_LLERROR_H
......@@ -188,4 +188,17 @@
#elif LL_DARWIN
#define LL_TYPEOF(exp) typeof(exp)
#endif
#define LL_TO_STRING_HELPER(x) #x
#define LL_TO_STRING(x) LL_TO_STRING_HELPER(x)
#define LL_FILE_LINENO(msg) __FILE__ "(" LL_TO_STRING(__LINE__) ") : " msg
#if LL_WINDOWS
#define LL_COMPILE_TIME_WARNING(msg) __pragma(message(LL_FILE_LINENO(msg)))
#define LL_COMPILE_TIME_ERROR(msg) static_assert(false, msg)
#else
// no way to get gcc 4.2 to print a user-defined diagnostic message only when a macro is used
#define LL_COMPILE_TIME_WARNING(msg)
#define LL_COMPILE_TIME_ERROR(msg)
#endif
#endif // not LL_LINDEN_PREPROCESSOR_H
......@@ -325,7 +325,7 @@ void LLStatBar::draw()
{
const LLTrace::TraceType<LLTrace::CountAccumulator>& count_stat = *mCountFloatp;
unit_label = mUnitLabel.empty() ? (std::string(count_stat.getUnitLabel()) + "/s") : mUnitLabel;
unit_label = std::string(count_stat.getUnitLabel()) + "/s";
current = last_frame_recording.getPerSec(count_stat);
min = frame_recording.getPeriodMinPerSec(count_stat, num_frames);
max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment