Skip to content
Snippets Groups Projects
Commit ed891c60 authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

SL-821: Add LL_TO_WSTRING() macro to llpreprocessor.h.

Also use existing LL_TO_STRING() macro to stringize LL_VIEWER_CHANNEL in
llversioninfo.cpp and its tests.
parent 41f4e854
No related branches found
No related tags found
No related merge requests found
...@@ -198,6 +198,8 @@ ...@@ -198,6 +198,8 @@
#define LL_TO_STRING_HELPER(x) #x #define LL_TO_STRING_HELPER(x) #x
#define LL_TO_STRING(x) LL_TO_STRING_HELPER(x) #define LL_TO_STRING(x) LL_TO_STRING_HELPER(x)
#define LL_TO_WSTRING_HELPER(x) L#x
#define LL_TO_WSTRING(x) LL_TO_WSTRING_HELPER(x)
#define LL_FILE_LINENO_MSG(msg) __FILE__ "(" LL_TO_STRING(__LINE__) ") : " msg #define LL_FILE_LINENO_MSG(msg) __FILE__ "(" LL_TO_STRING(__LINE__) ") : " msg
#define LL_GLUE_IMPL(x, y) x##y #define LL_GLUE_IMPL(x, y) x##y
#define LL_GLUE_TOKENS(x, y) LL_GLUE_IMPL(x, y) #define LL_GLUE_TOKENS(x, y) LL_GLUE_IMPL(x, y)
......
...@@ -101,14 +101,11 @@ namespace ...@@ -101,14 +101,11 @@ namespace
{ {
// LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The // LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The
// macro expands to the string name of the channel, but without quotes. We // macro expands to the string name of the channel, but without quotes. We
// need to turn it into a quoted string. This macro trick does that. // need to turn it into a quoted string. LL_TO_STRING() does that.
#define stringize_inner(x) #x
#define stringize_outer(x) stringize_inner(x)
/// Storage of the channel name the viewer is using. /// Storage of the channel name the viewer is using.
// The channel name is set by hardcoded constant, // The channel name is set by hardcoded constant,
// or by calling LLVersionInfo::resetChannel() // or by calling LLVersionInfo::resetChannel()
std::string sWorkingChannelName(stringize_outer(LL_VIEWER_CHANNEL)); std::string sWorkingChannelName(LL_TO_STRING(LL_VIEWER_CHANNEL));
// Storage for the "version and channel" string. // Storage for the "version and channel" string.
// This will get reset too. // This will get reset too.
......
...@@ -33,10 +33,8 @@ ...@@ -33,10 +33,8 @@
// LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The // LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The
// macro expands to the string name of the channel, but without quotes. We // macro expands to the string name of the channel, but without quotes. We
// need to turn it into a quoted string. This macro trick does that. // need to turn it into a quoted string. LL_TO_STRING() does that.
#define stringize_inner(x) #x #define ll_viewer_channel LL_TO_STRING(LL_VIEWER_CHANNEL)
#define stringize_outer(x) stringize_inner(x)
#define ll_viewer_channel stringize_outer(LL_VIEWER_CHANNEL)
namespace tut namespace tut
{ {
......
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