From 49e4959bf53cb03cc627b9e4671297bebaa80fba Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Oct 2010 21:23:50 -0500 Subject: [PATCH] More vc2010 stuff (part deux) --- indra/cmake/00-Common.cmake | 5 ++--- indra/cmake/Boost.cmake | 10 ++++++++++ indra/llui/llnotifications.cpp | 3 +++ indra/newview/llcommandlineparser.cpp | 21 +++++++++++++-------- indra/newview/llfeaturemanager.cpp | 3 +++ indra/newview/llfloaterpostcard.cpp | 3 +++ indra/newview/llgroupmgr.cpp | 3 +++ indra/newview/llpaneldisplay.cpp | 4 +++- 8 files changed, 40 insertions(+), 12 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index fa8af643f..d6847330e 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -53,10 +53,9 @@ if (WINDOWS) /Zc:forScope /nologo /Oy- - /Zc:wchar_t- #wchar_t is now on by default in VS2010. Force it to be disabled. ) - if(MSVC80 OR MSVC90) + if(MSVC80 OR MSVC90 OR MSVC100) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" CACHE STRING "C++ compiler release options" FORCE) @@ -67,7 +66,7 @@ if (WINDOWS) add_definitions( /Zc:wchar_t- ) - endif (MSVC80 OR MSVC90) + endif (MSVC80 OR MSVC90 OR MSVC100) # Are we using the crummy Visual Studio KDU build workaround? if (NOT VS_DISABLE_FATAL_WARNINGS) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index ac15bedad..915f4939c 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -36,6 +36,16 @@ else (STANDALONE) set(BOOST_SIGNALS_LIBRARY optimized libboost_signals-vc90-mt-${BOOST_VERSION} debug libboost_signals-vc90-mt-gd-${BOOST_VERSION}) + elseif (MSVC100) + set(BOOST_PROGRAM_OPTIONS_LIBRARY + optimized libboost_program_options-vc100-mt-${BOOST_VERSION} + debug libboost_program_options-vc100-mt-gd-${BOOST_VERSION}) + set(BOOST_REGEX_LIBRARY + optimized libboost_regex-vc100-mt-${BOOST_VERSION} + debug libboost_regex-vc100-mt-gd-${BOOST_VERSION}) + set(BOOST_SIGNALS_LIBRARY + optimized libboost_signals-vc100-mt-${BOOST_VERSION} + debug libboost_signals-vc100-mt-gd-${BOOST_VERSION}) endif (MSVC80) elseif (DARWIN) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 6b7dd0a3d..ef0de48cd 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -38,6 +38,9 @@ #include "llnotifications.h" #include +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index c74406bf3..ba6dd56cf 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -100,6 +100,7 @@ class LLCLPValue : public po::value_semantic_codecvt_helper unsigned mMinTokens; unsigned mMaxTokens; bool mIsComposing; + bool mIsRequired; typedef boost::function1 notify_callback_t; notify_callback_t mNotifyCallback; bool mLastOption; @@ -108,6 +109,7 @@ public: LLCLPValue() : mMinTokens(0), mMaxTokens(0), + mIsRequired(false), mIsComposing(false), mLastOption(false) {} @@ -139,6 +141,10 @@ public: mNotifyCallback = f; } + void setRequired(bool c) + { + mIsRequired = c; + } // Overrides to support the value_semantic interface. virtual std::string name() const { @@ -177,7 +183,10 @@ public: } } - + virtual bool is_required(void) const + { + return mIsRequired; + } protected: void xparse(boost::any& value_store, const std::vector& new_tokens) const @@ -244,17 +253,13 @@ void LLCommandLineParser::addOptionDesc(const std::string& option_name, value_desc->setComposing(composing); value_desc->setLastOption(last_option); - boost::shared_ptr d( - new po::option_description(boost_option_name.c_str(), - value_desc, - description.c_str())); - if(!notify_callback.empty()) { value_desc->setNotifyCallback(notify_callback); } - - gOptionsDesc.add(d); + + po::options_description_easy_init gEasyInitDesc(&gOptionsDesc); + gEasyInitDesc(boost_option_name.c_str(),value_desc, description.c_str()); if(positional) { diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 35613b7c3..5de7c6faf 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -35,6 +35,9 @@ #include #include +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include #include "llfeaturemanager.h" diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index b0ab0f962..4400a1071 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -64,6 +64,9 @@ #include "llassetuploadresponders.h" +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include //boost.regex lib ///---------------------------------------------------------------------------- diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index c13ec6303..01d21f250 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -54,6 +54,9 @@ #include "llfloaterdirectory.h" #include "llfloatergroupinfo.h" #include "lluictrlfactory.h" +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index 035b43ff0..154412188 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -83,6 +83,9 @@ // parent #include "llfloaterpreference.h" +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include const F32 MAX_USER_FAR_CLIP = 512.f; @@ -819,7 +822,6 @@ bool LLPanelDisplay::extractWindowSizeFromString(const std::string& instr, U32 & height = atoi(what[2].first); return true; } - width = height = 0; return false; }