diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index 8d2c8d79d75df2d66dc95c7d901b934056c77fd2..30bec3a6f89ad30985f852ce57d85ecacdfc41d9 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -1755,7 +1755,7 @@ bool LLStringUtilBase<T>::endsWith(
 template<class T>
 auto LLStringUtilBase<T>::getoptenv(const std::string& key) -> boost::optional<string_type>
 {
-    auto found{llstring_getoptenv(key)};
+    auto found(llstring_getoptenv(key));
     if (found)
     {
         // return populated boost::optional
@@ -1772,7 +1772,7 @@ auto LLStringUtilBase<T>::getoptenv(const std::string& key) -> boost::optional<s
 template<class T>
 auto LLStringUtilBase<T>::getenv(const std::string& key, const string_type& dflt) -> string_type
 {
-    auto found{getoptenv(key)};
+    auto found(getoptenv(key));
     if (found)
     {
         return *found;
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index bb5698842254e2019f7d65ce329bf4321413eb9a..9b43680949fa41b5c3191941f26afb3f01c2fe29 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -44,6 +44,12 @@
 // Third party library includes
 #include <boost/tokenizer.hpp>
 
+#if LL_WINDOWS
+#include <Shlobj.h>
+#include <Knownfolders.h>
+#include <Objbase.h>
+#endif // LL_WINDOWS
+
 const S32 BOLD_OFFSET = 1;
 
 // static class members
diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp
index acf734f16b2a17c2b15fbd132845b78bdc441bc5..b3b3afb37e61c1f474622601b818a61a611cc6d8 100644
--- a/indra/llvfs/lldir_win32.cpp
+++ b/indra/llvfs/lldir_win32.cpp
@@ -54,15 +54,15 @@ namespace
 
     void prelog(const std::string& message)
     {
+        boost::optional<std::string> prelog_name;
+
         switch (state)
         {
-            boost::optional<std::string> prelog_name;
-
         case prst::INIT:
             // assume we failed, until we succeed
             state = prst::SKIP;
 
-            prelog_name = LLDirUtil::getoptenv("PRELOG");
+            prelog_name = LLStringUtil::getoptenv("PRELOG");
             if (! prelog_name)
                 // no PRELOG variable set, carry on
                 return;