diff options
Diffstat (limited to 'indra/llcommon')
-rwxr-xr-x | indra/llcommon/llerror.h | 14 | ||||
-rwxr-xr-x | indra/llcommon/llpreprocessor.h | 13 |
2 files changed, 20 insertions, 7 deletions
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 6eaab450ed..88e5dfdcf1 100755 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -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 diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index e5c8482ed1..eea63d443f 100755 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.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 |