diff --git a/doc/contributions.txt b/doc/contributions.txt
index 8c5bb3d5763a496c05784b980182836c8f8e448e..a4d1f6d5919a3e37281d74ce818fbc74d30c7735 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -901,6 +901,7 @@ Nicky Dasmijn
 	MAINT-873
 	SUN-72
 	BUG-2432
+	BUG-2707
 Nicky Perian
 	OPEN-1
 	STORM-1087
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h
index a2a69933300d53453f2063262b63dfe46f896f4a..cc9bfba81826d57dd1fd800093475010fe0d0ec8 100755
--- a/indra/llcommon/llerror.h
+++ b/indra/llcommon/llerror.h
@@ -206,10 +206,8 @@ namespace LLError
 }
 
 #if LL_WINDOWS
-	// Macro accepting a wchar_t* for display in windows debugging console in debug builds only
-	// (wchar_t flavor chosen for maximal utility with unicode text debugging)
-	//
-	#define LL_WINDOWS_OUTPUT_DEBUG(a) LLError::LLOutputDebugUTF8((a))
+	// Macro accepting a const std::string& for display in windows debugging console in debug builds only
+	#define LL_WINDOWS_OUTPUT_DEBUG(a) LLError::LLOutputDebugUTF8(a)
 #else
 	#define LL_WINDOWS_OUTPUT_DEBUG(a)
 #endif
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index a45c4ced2eec2c1338c3f46a4df82488470c8579..588f8dfc34852883d132ec3385cf4d6217c9dd02 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -3207,13 +3207,13 @@ S32	LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
 
 	if(getLength() < segment_offset + mStart)
 	{ 
-		llinfos << "getLength() < segment_offset + mStart\t getLength()\t" << getLength() << "\tsegment_offset:\t" 
+		llerrs << "getLength() < segment_offset + mStart\t getLength()\t" << getLength() << "\tsegment_offset:\t" 
 						<< segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << llendl;
 	}
 
 	if(offsetString.length() + 1 < max_chars)
 	{
-		llinfos << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetString.length() << " getLength() : "
+		llerrs << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetString.length()
 			<< getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << llendl;
 	}
 	
diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp
index ee570ce51fbf7104ccd02166432b87ea09900a56..6322da91235d90a3084371f61d8d03503828b2cd 100755
--- a/indra/llui/llxuiparser.cpp
+++ b/indra/llui/llxuiparser.cpp
@@ -1309,7 +1309,7 @@ bool LLXUIParser::writeSDValue(Parser& parser, const void* val_ptr, name_stack_t
 void LLXUIParser::parserWarning(const std::string& message)
 {
 #ifdef LL_WINDOWS
-	// use Visual Studo friendly formatting of output message for easy access to originating xml
+	// use Visual Studio friendly formatting of output message for easy access to originating xml
 	LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()));
 #else
 	Parser::parserWarning(message);
@@ -1319,6 +1319,7 @@ void LLXUIParser::parserWarning(const std::string& message)
 void LLXUIParser::parserError(const std::string& message)
 {
 #ifdef LL_WINDOWS
+        // use Visual Studio friendly formatting of output message for easy access to originating xml
 	LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()));
 #else
 	Parser::parserError(message);
@@ -1636,7 +1637,7 @@ bool LLSimpleXUIParser::processText()
 void LLSimpleXUIParser::parserWarning(const std::string& message)
 {
 #ifdef LL_WINDOWS
-	// use Visual Studo friendly formatting of output message for easy access to originating xml
+	// use Visual Studio friendly formatting of output message for easy access to originating xml
 	LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()));
 #else
 	Parser::parserWarning(message);
@@ -1646,6 +1647,7 @@ void LLSimpleXUIParser::parserWarning(const std::string& message)
 void LLSimpleXUIParser::parserError(const std::string& message)
 {
 #ifdef LL_WINDOWS
+        // use Visual Studio friendly formatting of output message for easy access to originating xml
 	LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()));
 #else
 	Parser::parserError(message);
diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l
index 1bb38bbf655f5c3313db95b81055e6cb52b2a2eb..b2c49083cb267398b1c32ce636317b40504b84a8 100755
--- a/indra/lscript/lscript_compile/indra.l
+++ b/indra/lscript/lscript_compile/indra.l
@@ -79,9 +79,11 @@ void parse_string();
 #define yyfree indra_free
 
 
-int yylex( void );
-int yyparse( void );
-int yyerror(const char *fmt, ...);
+#if defined(__cplusplus)
+extern "C" { int yylex( void ); }
+extern "C" { int yyparse( void ); }
+extern "C" { int yyerror(const char *fmt, ...); }
+#endif
 
 %}
 
diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y
index a0a034d21c2251a9035825f72e2781c80ced719c..e4b10ffdd9da7d96dd1a75217a65de0964056a72 100755
--- a/indra/lscript/lscript_compile/indra.y
+++ b/indra/lscript/lscript_compile/indra.y
@@ -2,6 +2,10 @@
 	#include "linden_common.h"
 	#include "lscript_tree.h"
 
+    #ifdef __cplusplus
+    extern "C" {
+    #endif
+
 	int yylex(void);
 	int yyparse( void );
 	int yyerror(const char *fmt, ...);
@@ -16,6 +20,9 @@
 	#pragma warning( disable : 4065 )	// warning: switch statement contains 'default' but no 'case' labels
 	#endif
 
+    #ifdef __cplusplus
+    }
+    #endif
 %}
 
 %union
diff --git a/indra/media_plugins/winmmshim/winmm_shim.cpp b/indra/media_plugins/winmmshim/winmm_shim.cpp
index 9e2e7ad3aa5f98965563773eb89d7be03549062a..47a1e5c0187acf98e37cad50e763433170f8c27a 100755
--- a/indra/media_plugins/winmmshim/winmm_shim.cpp
+++ b/indra/media_plugins/winmmshim/winmm_shim.cpp
@@ -61,18 +61,13 @@ void ll_winmm_shim_initialize(){
 		{	// we have a dll, let's get out pointers!
 			initialized = true;
 			init_function_pointers(winmm_handle);
-#if defined(_DEBUG)
 			::OutputDebugStringA("WINMM_SHIM.DLL: real winmm.dll initialized successfully\n");
-#endif
 		}
-#if defined(_DEBUG)
 		else
 		{
 			// failed to initialize real winmm.dll
 			::OutputDebugStringA("WINMM_SHIM.DLL: Failed to initialize real winmm.dll\n");
 		}
-#endif
-
 	}
 	LeaveCriticalSection(&sCriticalSection);
 }