------------------------------------------------------------ revno: 2873 committer: poy <[email protected]> branch nick: trunk timestamp: Sat 2012-03-03 16:04:23 +0100 message: switch to VC 11 removed: msvc/container/ msvc/container/custom_hash.h msvc/container/deque msvc/container/list msvc/container/map msvc/container/readme.txt msvc/container/set msvc/container/unordered_map msvc/container/unordered_set msvc/container/vector modified: Compile.txt SConstruct build_util.py dcpp/FavoriteManager.cpp dcpp/MappingManager.cpp dcpp/MappingManager.h dcpp/SConscript dcpp/ShareManager.cpp dcpp/ShareManager.h dcpp/Socket.cpp dcpp/atomic.h dcpp/compiler.h dwt/include/dwt/Message.h dwt/src/SConscript dwt/test/SConscript openssl/build/build.bat test/SConscript utils/SConscript win32/DCPlusPlus.rc win32/SConscript win32/compiler.h
-- lp:dcplusplus https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk Your team Dcplusplus-team is subscribed to branch lp:dcplusplus. To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'Compile.txt' --- Compile.txt 2011-10-16 23:06:25 +0000 +++ Compile.txt 2012-03-03 15:04:23 +0000 @@ -73,7 +73,7 @@ Also grab natupnp.h from the Windows SDK and place it in the root of the repository. <http://msdn.microsoft.com/en-us/windows/bb980924> - b. Microsoft Visual C++ 10 (2010): + b. Microsoft Visual C++ 11: <http://msdn.microsoft.com/en-us/visualc/default.aspx> Download OpenSSL from www.openssl.org and compile it. You should get libraries called === modified file 'SConstruct' --- SConstruct 2012-01-23 20:45:16 +0000 +++ SConstruct 2012-03-03 15:04:23 +0000 @@ -54,8 +54,9 @@ 'release' : [] } +# TODO remove _VARIADIC_MAX if/when VC has proper variadic template support msvc_defs = { - 'common' : ['_REENTRANT', 'snprintf=_snprintf'], + 'common' : ['_REENTRANT', '_VARIADIC_MAX=10', 'snprintf=_snprintf'], 'debug' : ['_DEBUG', '_HAS_ITERATOR_DEBUGGING=0', '_SECURE_SCL=0'], 'release' : ['NDEBUG'] } @@ -107,7 +108,9 @@ if TARGET_ARCH == 'x64': TARGET_ARCH = 'amd64' -env = Environment(ENV = os.environ, tools = [defEnv['tools']], options = opts, TARGET_ARCH = TARGET_ARCH, MSVS_ARCH = TARGET_ARCH) +env = Environment(ENV = os.environ, tools = [defEnv['tools']], options = opts, + TARGET_ARCH = TARGET_ARCH, MSVS_ARCH = TARGET_ARCH, + MSVC_USE_SCRIPT = False) # TODO this disables SCons' automatic env setup as it doesn't know about VC 11 yet if 'mingw' not in env['TOOLS'] and 'gcc' in env['TOOLS']: raise Exception('Non-mingw gcc builds not supported') === modified file 'build_util.py' --- build_util.py 2012-01-23 20:45:16 +0000 +++ build_util.py 2012-03-03 15:04:23 +0000 @@ -136,7 +136,9 @@ if 'msvc' in env['TOOLS']: env['PCHSTOP'] = precompiled_header + '.h' - env['PCH'] = env.PCH(build_path + precompiled_header + '.pch', precompiled_header + '.cpp')[0] + pch = env.PCH(build_path + precompiled_header + '.pch', precompiled_header + '.cpp') + env['PCH'] = pch[0] + sources.append(pch[1]) elif 'gcc' in env['TOOLS']: env['Gch'] = env.Gch(build_path + precompiled_header + '.h.gch', precompiled_header + '.h')[0] @@ -220,14 +222,6 @@ asciidoc = 'python ' + asciidoc return asciidoc - # switch to boost containers instead of default STL containers on MSVC for the given project. - def msvc_boost_containers(self, env): - if 'msvc' in env['TOOLS']: - env.Append(CPPPATH = ['#/msvc/container/']) - # define include guards of STL files to make sure only boost containers are used. - env.Append(CPPDEFINES = ['_DEQUE_', '_LIST_', '_MAP_', '_SET_', '_UNORDERED_MAP_', '_UNORDERED_SET_', '_VECTOR_', - 'BOOST_DETAIL_NO_CONTAINER_FWD']) # see boost/detail/container_fwd.hpp - # source is *one* SCons file node (not a list!) designating the .po file def get_po_name(source): # rely on the comments at the beginning of the po file to find the language name. === modified file 'dcpp/FavoriteManager.cpp' --- dcpp/FavoriteManager.cpp 2012-02-04 15:43:31 +0000 +++ dcpp/FavoriteManager.cpp 2012-03-03 15:04:23 +0000 @@ -292,7 +292,7 @@ const string& maxUsers = getAttrib(attribs, "Maxusers", 5); const string& reliability = getAttrib(attribs, "Reliability", 5); const string& rating = getAttrib(attribs, "Rating", 5); - /// @todo change to emplace_back when MSVC has templates with var args, thus allowing these 12 arguments! (boost emulation only goes to 10) + /// @todo change to emplace_back when MSVC has templates with var args, thus allowing these 12 arguments! (its current emulation only goes up to 10) publicHubs.push_back(HubEntry(name, server, description, users, country, shared, minShare, minSlots, maxHubs, maxUsers, reliability, rating)); } } === modified file 'dcpp/MappingManager.cpp' --- dcpp/MappingManager.cpp 2012-02-21 22:11:22 +0000 +++ dcpp/MappingManager.cpp 2012-03-03 15:04:23 +0000 @@ -32,7 +32,9 @@ namespace dcpp { -MappingManager::MappingManager() : busy(false), renewal(0) { +atomic_flag MappingManager::busy = ATOMIC_FLAG_INIT; + +MappingManager::MappingManager() : renewal(0) { addMapper<Mapper_NATPMP>(); addMapper<Mapper_MiniUPnPc>(); addMapper<Mapper_WinUPnP>(); === modified file 'dcpp/MappingManager.h' --- dcpp/MappingManager.h 2012-02-21 22:11:22 +0000 +++ dcpp/MappingManager.h 2012-03-03 15:04:23 +0000 @@ -45,16 +45,9 @@ /** add an implementation derived from the base Mapper class, passed as template parameter. the first added mapper will be tried first, unless the "MAPPER" setting is not empty. */ template<typename T> void addMapper() { -#ifndef _MSC_VER mappers.emplace_back(T::name, [](string&& localIp) { return new T(std::forward<string>(localIp)); }); -#else - // the rvalue ref deal is too smart for MSVC; resort to a string copy... - mappers.push_back(make_pair(T::name, [](string localIp) { - return new T(std::move(localIp)); - })); -#endif } StringList getMappers() const; @@ -69,13 +62,9 @@ private: friend class Singleton<MappingManager>; -#ifndef _MSC_VER vector<pair<string, function<Mapper* (string&&)>>> mappers; -#else - vector<pair<string, function<Mapper* (const string&)>>> mappers; -#endif - atomic_flag busy; + static atomic_flag busy; unique_ptr<Mapper> working; /// currently working implementation. uint64_t renewal; /// when the next renewal should happen, if requested by the mapper. === modified file 'dcpp/SConscript' --- dcpp/SConscript 2012-01-23 17:56:18 +0000 +++ dcpp/SConscript 2012-03-03 15:04:23 +0000 @@ -8,8 +8,6 @@ env.Append(CPPDEFINES = ['BUILDING_DCPP=1']) -dev.msvc_boost_containers(env) - headers=dev.get_sources(source_path, "*.h") dev.i18n(source_path, env, [sources, headers], 'libdcpp') === modified file 'dcpp/ShareManager.cpp' --- dcpp/ShareManager.cpp 2012-02-04 15:43:31 +0000 +++ dcpp/ShareManager.cpp 2012-03-03 15:04:23 +0000 @@ -51,8 +51,10 @@ using std::numeric_limits; +atomic_flag ShareManager::refreshing = ATOMIC_FLAG_INIT; + ShareManager::ShareManager() : hits(0), xmlListLen(0), bzXmlListLen(0), - xmlDirty(true), forceXmlRefresh(true), refreshDirs(false), update(false), initial(true), listN(0), refreshing(false), + xmlDirty(true), forceXmlRefresh(true), refreshDirs(false), update(false), initial(true), listN(0), lastXmlUpdate(0), lastFullUpdate(GET_TICK()), bloom(1<<20) { SettingsManager::getInstance()->addListener(this); === modified file 'dcpp/ShareManager.h' --- dcpp/ShareManager.h 2012-01-13 20:55:20 +0000 +++ dcpp/ShareManager.h 2012-03-03 15:04:23 +0000 @@ -249,7 +249,7 @@ int listN; - atomic_flag refreshing; + static atomic_flag refreshing; uint64_t lastXmlUpdate; uint64_t lastFullUpdate; === modified file 'dcpp/Socket.cpp' --- dcpp/Socket.cpp 2012-01-13 20:55:20 +0000 +++ dcpp/Socket.cpp 2012-03-03 15:04:23 +0000 @@ -484,14 +484,17 @@ } void Socket::setSocketOpt(int option, int val) { + if(option==SO_RCVBUF) { printf("setting SO_RCVBUF - 0\n"); } int len = sizeof(val); if(sock4.valid()) { check([&] { return ::setsockopt(sock4, SOL_SOCKET, option, (char*)&val, len); }); } + if(option==SO_RCVBUF) { printf("setting SO_RCVBUF - 1\n"); } if(sock6.valid()) { check([&] { return ::setsockopt(sock6, SOL_SOCKET, option, (char*)&val, len); }); } + if(option==SO_RCVBUF) { printf("setting SO_RCVBUF - 2\n"); } } int Socket::read(void* aBuffer, int aBufLen) { === modified file 'dcpp/atomic.h' --- dcpp/atomic.h 2012-01-13 20:55:20 +0000 +++ dcpp/atomic.h 2012-03-03 15:04:23 +0000 @@ -20,8 +20,7 @@ #define DCPLUSPLUS_DCPP_ATOMIC_HPP_ // GCC 4.6 and below has issues with atomic - see https://bugs.launchpad.net/dcplusplus/+bug/735512 -// MSVC 10 doesn't have atomic at all -#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)) || defined(_MSC_VER) +#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)) #include <boost/atomic.hpp> @@ -33,6 +32,10 @@ } +#ifndef ATOMIC_FLAG_INIT +#define ATOMIC_FLAG_INIT { 0 } +#endif + #else #include <atomic> === modified file 'dcpp/compiler.h' --- dcpp/compiler.h 2012-01-23 20:18:58 +0000 +++ dcpp/compiler.h 2012-03-03 15:04:23 +0000 @@ -29,8 +29,8 @@ #endif #elif defined(_MSC_VER) -#if _MSC_VER < 1600 -#error MSVC 10 (2010) is required +#if _MSC_VER < 1700 +#error MSVC 11 is required #endif //disable the deprecated warnings for the CRT functions. === modified file 'dwt/include/dwt/Message.h' --- dwt/include/dwt/Message.h 2012-01-13 20:55:20 +0000 +++ dwt/include/dwt/Message.h 2012-03-03 15:04:23 +0000 @@ -81,7 +81,7 @@ bool operator<(const Message& rhs) const; bool operator==(const Message& rhs) const; private: - friend class std::hash<Message>; + friend struct std::hash<Message>; /// Contains the actual Message UINT msg; === modified file 'dwt/src/SConscript' --- dwt/src/SConscript 2012-01-23 17:56:18 +0000 +++ dwt/src/SConscript 2012-03-03 15:04:23 +0000 @@ -4,8 +4,6 @@ env.Append(CPPPATH = ['#/dwt/include']) -dev.msvc_boost_containers(env) - def get_msvcproj_files(env): def parse_patterns(patterns): array = [] === modified file 'dwt/test/SConscript' --- dwt/test/SConscript 2012-01-23 17:56:18 +0000 +++ dwt/test/SConscript 2012-03-03 15:04:23 +0000 @@ -8,8 +8,6 @@ env.Append(CPPPATH = ['#/dwt/include']) -dev.msvc_boost_containers(env) - # imitate build_util's prepare_build env.VariantDir(dev.get_build_path(source_path), '.', duplicate = 0) if env['msvcproj']: === removed directory 'msvc/container' === removed file 'msvc/container/custom_hash.h' --- msvc/container/custom_hash.h 2012-01-23 17:56:18 +0000 +++ msvc/container/custom_hash.h 1970-01-01 00:00:00 +0000 @@ -1,16 +0,0 @@ -#ifndef DCPP_BOOST_CONTAINER_CUSTOM_HASH -#define DCPP_BOOST_CONTAINER_CUSTOM_HASH - -/* boost & STL have different ways of specifying a custom hash. since DC++ only uses the STL way, - * this defines a generic boost hash function that redirects to STL ones. */ - -namespace boost { - template<typename T> - inline size_t hash_value(const T& t) { - return std::hash<T>()(t); - } -} - -#endif - -// vim: set filetype=cpp : === removed file 'msvc/container/deque' --- msvc/container/deque 2012-01-23 17:56:18 +0000 +++ msvc/container/deque 1970-01-01 00:00:00 +0000 @@ -1,12 +0,0 @@ -#ifndef DCPP_BOOST_CONTAINER_DEQUE -#define DCPP_BOOST_CONTAINER_DEQUE - -#include <boost/container/deque.hpp> - -namespace std { - using boost::container::deque; -} - -#endif - -// vim: set filetype=cpp : === removed file 'msvc/container/list' --- msvc/container/list 2012-01-23 17:56:18 +0000 +++ msvc/container/list 1970-01-01 00:00:00 +0000 @@ -1,12 +0,0 @@ -#ifndef DCPP_BOOST_CONTAINER_LIST -#define DCPP_BOOST_CONTAINER_LIST - -#include <boost/container/list.hpp> - -namespace std { - using boost::container::list; -} - -#endif - -// vim: set filetype=cpp : === removed file 'msvc/container/map' --- msvc/container/map 2012-01-23 20:45:16 +0000 +++ msvc/container/map 1970-01-01 00:00:00 +0000 @@ -1,13 +0,0 @@ -#ifndef DCPP_BOOST_CONTAINER_MAP -#define DCPP_BOOST_CONTAINER_MAP - -#include <boost/container/map.hpp> - -namespace std { - using boost::container::map; - using boost::container::multimap; -} - -#endif - -// vim: set filetype=cpp : === removed file 'msvc/container/readme.txt' --- msvc/container/readme.txt 2012-01-23 17:56:18 +0000 +++ msvc/container/readme.txt 1970-01-01 00:00:00 +0000 @@ -1,3 +0,0 @@ -This directory contains include files that short-circuit MSVC's standard container implementation -in favor of the one provided by Boost.Container. This allows, in particular, emplace / emplace_back -with variable arguments which MSVC is lacking (as of 2010). === removed file 'msvc/container/set' --- msvc/container/set 2012-01-23 20:45:16 +0000 +++ msvc/container/set 1970-01-01 00:00:00 +0000 @@ -1,13 +0,0 @@ -#ifndef DCPP_BOOST_CONTAINER_SET -#define DCPP_BOOST_CONTAINER_SET - -#include <boost/container/set.hpp> - -namespace std { - using boost::container::set; - using boost::container::multiset; -} - -#endif - -// vim: set filetype=cpp : === removed file 'msvc/container/unordered_map' --- msvc/container/unordered_map 2012-01-23 17:56:18 +0000 +++ msvc/container/unordered_map 1970-01-01 00:00:00 +0000 @@ -1,17 +0,0 @@ -#ifndef DCPP_BOOST_CONTAINER_UNORDERED_MAP -#define DCPP_BOOST_CONTAINER_UNORDERED_MAP - -#include <vector> - -#include <boost/unordered/unordered_map.hpp> - -namespace std { - using boost::unordered_map; - using boost::unordered_multimap; -} - -#include "custom_hash.h" - -#endif - -// vim: set filetype=cpp : === removed file 'msvc/container/unordered_set' --- msvc/container/unordered_set 2012-01-23 17:56:18 +0000 +++ msvc/container/unordered_set 1970-01-01 00:00:00 +0000 @@ -1,17 +0,0 @@ -#ifndef DCPP_BOOST_CONTAINER_UNORDERED_SET -#define DCPP_BOOST_CONTAINER_UNORDERED_SET - -#include <vector> - -#include <boost/unordered/unordered_set.hpp> - -namespace std { - using boost::unordered_set; - using boost::unordered_multiset; -} - -#include "custom_hash.h" - -#endif - -// vim: set filetype=cpp : === removed file 'msvc/container/vector' --- msvc/container/vector 2012-01-23 17:56:18 +0000 +++ msvc/container/vector 1970-01-01 00:00:00 +0000 @@ -1,12 +0,0 @@ -#ifndef DCPP_BOOST_CONTAINER_VECTOR -#define DCPP_BOOST_CONTAINER_VECTOR - -#include <boost/container/vector.hpp> - -namespace std { - using boost::container::vector; -} - -#endif - -// vim: set filetype=cpp : === modified file 'openssl/build/build.bat' --- openssl/build/build.bat 2011-06-04 18:26:04 +0000 +++ openssl/build/build.bat 2012-03-03 15:04:23 +0000 @@ -3,7 +3,7 @@ echo on if errorlevel 2 goto end -set VCDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC +set VCDIR=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC mv ../include/openssl/opensslconf.h . rm -rf ../include ../lib === modified file 'test/SConscript' --- test/SConscript 2012-01-23 17:56:18 +0000 +++ test/SConscript 2012-03-03 15:04:23 +0000 @@ -46,8 +46,6 @@ openssl_lib += env['arch'] + '/' env.Append(LIBPATH = [openssl_lib]) -dev.msvc_boost_containers(env) - if env['msvcproj']: ret = dev.build_lib(env, target, sources, dev.cpp_lib) else: === modified file 'utils/SConscript' --- utils/SConscript 2012-01-23 17:56:18 +0000 +++ utils/SConscript 2012-03-03 15:04:23 +0000 @@ -35,8 +35,6 @@ openssl_lib += env['arch'] + '/' env.Append(LIBPATH = [openssl_lib]) -dev.msvc_boost_containers(env) - # imitate build_util's prepare_build env.VariantDir(dev.get_build_path(source_path), '.', duplicate = 0) if env['msvcproj']: === modified file 'win32/DCPlusPlus.rc' --- win32/DCPlusPlus.rc 2012-01-16 17:56:17 +0000 +++ win32/DCPlusPlus.rc 2012-03-03 15:04:23 +0000 @@ -1,23 +1,4 @@ -// Microsoft Visual C++ generated resource script. -// #include "resource.h" -#include <winuser.h> -#include <commctrl.h> -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "win32/resource.h\0" -END - -#endif // APSTUDIO_INVOKED #if defined x86 1 24 "res/DCPlusPlus.manifest.x86" === modified file 'win32/SConscript' --- win32/SConscript 2012-01-23 17:56:18 +0000 +++ win32/SConscript 2012-03-03 15:04:23 +0000 @@ -32,8 +32,6 @@ openssl_lib += env['arch'] + '/' env.Append(LIBPATH = [openssl_lib]) -dev.msvc_boost_containers(env) - if env['RC'] == 'rc': # MSVC env.Append(RCFLAGS = ['/d' + env['arch']]) elif env['RC'].find('windres') != -1: # MinGW === modified file 'win32/compiler.h' --- win32/compiler.h 2012-01-13 20:55:20 +0000 +++ win32/compiler.h 2012-03-03 15:04:23 +0000 @@ -22,8 +22,8 @@ #endif #elif defined(_MSC_VER) -#if _MSC_VER < 1600 -#error MSVC 10 (2010) is required +#if _MSC_VER < 1700 +#error MSVC 11 is required #endif #else
_______________________________________________ Mailing list: https://launchpad.net/~linuxdcpp-team Post to : [email protected] Unsubscribe : https://launchpad.net/~linuxdcpp-team More help : https://help.launchpad.net/ListHelp

