diff --git a/ext/json-parser/json.c b/ext/json-parser/json.c index 6012bad7d..166cdcb60 100644 --- a/ext/json-parser/json.c +++ b/ext/json-parser/json.c @@ -33,6 +33,7 @@ #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif + #pragma warning(disable:4996) #endif const struct _json_value json_value_none; diff --git a/node/BandwidthAccount.hpp b/node/BandwidthAccount.hpp index b6ebfa3e5..3a6432c44 100644 --- a/node/BandwidthAccount.hpp +++ b/node/BandwidthAccount.hpp @@ -28,10 +28,13 @@ #ifndef ZT_BWACCOUNT_HPP #define ZT_BWACCOUNT_HPP +#include "Constants.hpp" + +#include + #include #include -#include "Constants.hpp" #include "Utils.hpp" #ifdef __WINDOWS__ diff --git a/node/Constants.hpp b/node/Constants.hpp index cefd48633..10c48c20a 100644 --- a/node/Constants.hpp +++ b/node/Constants.hpp @@ -91,7 +91,9 @@ #ifndef __WINDOWS__ #define __WINDOWS__ #endif +#ifndef NOMINMAX #define NOMINMAX +#endif #pragma warning(disable : 4290) #pragma warning(disable : 4996) #pragma warning(disable : 4101) diff --git a/node/Node.cpp b/node/Node.cpp index 2ffdeb96c..855b8266e 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -60,7 +60,7 @@ Node::Node( ZT1_EventCallback eventCallback, const char *overrideRootTopology) : RR(new RuntimeEnvironment(this)), - _uptr(uptr), + _uPtr(uptr), _dataStoreGetFunction(dataStoreGetFunction), _dataStorePutFunction(dataStorePutFunction), _wirePacketSendFunction(wirePacketSendFunction), @@ -426,7 +426,7 @@ std::string Node::dataStoreGet(const char *name) std::string r; unsigned long olen = 0; do { - long n = _dataStoreGetFunction(reinterpret_cast(this),_uptr,name,buf,sizeof(buf),r.length(),&olen); + long n = _dataStoreGetFunction(reinterpret_cast(this),_uPtr,name,buf,sizeof(buf),r.length(),&olen); if (n <= 0) return std::string(); r.append(buf,n); diff --git a/node/Node.hpp b/node/Node.hpp index f07776dad..396e04c0f 100644 --- a/node/Node.hpp +++ b/node/Node.hpp @@ -127,7 +127,7 @@ public: { return (_wirePacketSendFunction( reinterpret_cast(this), - _uptr, + _uPtr, reinterpret_cast(&addr), desperation, data, @@ -149,7 +149,7 @@ public: { _virtualNetworkFrameFunction( reinterpret_cast(this), - _uptr, + _uPtr, nwid, source.toInt(), dest.toInt(), @@ -192,9 +192,9 @@ public: */ inline unsigned int coreDesperation() const throw() { return _coreDesperation; } - inline bool dataStorePut(const char *name,const void *data,unsigned int len,bool secure) { return (_dataStorePutFunction(reinterpret_cast(this),_uptr,name,data,len,(int)secure) == 0); } + inline bool dataStorePut(const char *name,const void *data,unsigned int len,bool secure) { return (_dataStorePutFunction(reinterpret_cast(this),_uPtr,name,data,len,(int)secure) == 0); } inline bool dataStorePut(const char *name,const std::string &data,bool secure) { return dataStorePut(name,(const void *)data.data(),(unsigned int)data.length(),secure); } - inline void dataStoreDelete(const char *name) { _dataStorePutFunction(reinterpret_cast(this),_uptr,name,(const void *)0,0,0); } + inline void dataStoreDelete(const char *name) { _dataStorePutFunction(reinterpret_cast(this),_uPtr,name,(const void *)0,0,0); } std::string dataStoreGet(const char *name); /** @@ -203,7 +203,7 @@ public: * @param ev Event type * @param md Meta-data (default: NULL/none) */ - inline void postEvent(ZT1_Event ev,const void *md = (const void *)0) { _eventCallback(reinterpret_cast(this),_uptr,ev,md); } + inline void postEvent(ZT1_Event ev,const void *md = (const void *)0) { _eventCallback(reinterpret_cast(this),_uPtr,ev,md); } /** * Update virtual network port configuration @@ -212,7 +212,7 @@ public: * @param op Configuration operation * @param nc Network configuration */ - inline int configureVirtualNetworkPort(uint64_t nwid,ZT1_VirtualNetworkConfigOperation op,const ZT1_VirtualNetworkConfig *nc) { return _virtualNetworkConfigFunction(reinterpret_cast(this),_uptr,nwid,op,nc); } + inline int configureVirtualNetworkPort(uint64_t nwid,ZT1_VirtualNetworkConfigOperation op,const ZT1_VirtualNetworkConfig *nc) { return _virtualNetworkConfigFunction(reinterpret_cast(this),_uPtr,nwid,op,nc); } /** * @return True if we appear to be online @@ -231,7 +231,7 @@ public: private: RuntimeEnvironment *RR; - void *_uptr; + void *_uPtr; // _uptr (lower case) is reserved in Visual Studio :P ZT1_DataStoreGetFunction _dataStoreGetFunction; ZT1_DataStorePutFunction _dataStorePutFunction; diff --git a/node/Peer.hpp b/node/Peer.hpp index d9ed56703..e36b0c7b6 100644 --- a/node/Peer.hpp +++ b/node/Peer.hpp @@ -30,6 +30,8 @@ #include +#include "Constants.hpp" + #include #include #include @@ -37,7 +39,6 @@ #include "../include/ZeroTierOne.h" -#include "Constants.hpp" #include "RuntimeEnvironment.hpp" #include "Path.hpp" #include "Address.hpp" diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index a651b5f73..6ee776b17 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -19,87 +19,40 @@ - - - - + + - - - - - - + - - - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - + + + + + + - - - - + + @@ -114,55 +67,41 @@ - - - - + - - - + - - - - - - - - - - - - - - + + + + + + + + - - - @@ -240,7 +179,7 @@ Disabled true $(SolutionDir)\ext\bin\libcrypto\include - ZT_LOG_STDOUT;ZT_TRACE;%(PreprocessorDefinitions) + NOMINMAX;ZT_TRACE;%(PreprocessorDefinitions) true @@ -254,7 +193,7 @@ Disabled true $(SolutionDir)\ext\bin\libcrypto\include - ZT_LOG_STDOUT;ZT_TRACE;%(PreprocessorDefinitions) + NOMINMAX;ZT_TRACE;%(PreprocessorDefinitions) true @@ -270,7 +209,7 @@ true true $(SolutionDir)\ext\bin\libcrypto\include - ZT_OFFICIAL_RELEASE;ZT_AUTO_UPDATE;ZT_SALSA20_SSE;%(PreprocessorDefinitions) + ZT_OFFICIAL_RELEASE;ZT_AUTO_UPDATE;ZT_SALSA20_SSE;NOMINMAX;%(PreprocessorDefinitions) MultiThreaded NoExtensions true @@ -294,7 +233,7 @@ true true $(SolutionDir)\ext\bin\libcrypto\include - ZT_OFFICIAL_RELEASE;ZT_AUTO_UPDATE;ZT_SALSA20_SSE;%(PreprocessorDefinitions) + ZT_OFFICIAL_RELEASE;ZT_AUTO_UPDATE;ZT_SALSA20_SSE;NOMINMAX;%(PreprocessorDefinitions) MultiThreaded NotSet true diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 8771af7e4..be0997454 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -16,36 +16,66 @@ {67b1c0f8-b018-4169-9c14-7032ed12c786} - - {64683235-3edd-443c-828c-c8e657d3bfd7} - - - {c8a3c54f-bb49-4c3f-b406-5177bc14a447} - - - {142d7af3-1770-44d7-bd87-d509bb25be1e} - {40761a4c-e8db-4a91-9cab-7afef332f4a8} - - {066d9967-d4f3-4b41-b9a8-b18ea763aca3} - {da3b8126-840c-45db-8abe-9d7e7976f8be} - - {173e391d-1519-41b8-960b-9b8dad083827} + + {6054dfae-4ed2-4d69-8cf5-d6f27646f2d7} - - {6f36ddd5-a2e1-48e1-9543-1ab975f91780} + + {9944293a-4a1a-40e9-b92a-eff31fe87e2c} + + + {ca21bd6b-ff4e-4f9e-bedd-c9f603d2d0d6} + + + {e1743b3c-1d18-47f1-ab5a-f5703c19f1df} + + + {71865460-d693-4c73-84f6-dbff42f49df6} + + + {17ae9a01-d39f-4c6d-a800-8f2cd0804c96} + + + {736aad7f-8d95-4602-88df-3bb970869c6f} + + + {3636527c-bc03-4852-bd3c-20ee25e56d82} + + + {7784af31-5b60-4300-b07e-44cf864c54db} + + + {29164186-10fc-45f5-b253-6d03f0ddd4db} + + + {f8a1c208-15b8-4d85-a4cb-11d2b82f2d1e} + + + {da28e961-1761-41d8-9a59-65b00dfb1302} - - Source Files + + Source Files\service - + + Source Files\service + + + Source Files\osdep + + + Source Files\osdep + + + Source Files\osdep + + Source Files @@ -60,9 +90,6 @@ Source Files\node - - Source Files\node - Source Files\node @@ -72,9 +99,6 @@ Source Files\node - - Source Files\node - Source Files\node @@ -87,9 +111,6 @@ Source Files\node - - Source Files\node - Source Files\node @@ -102,21 +123,15 @@ Source Files\node - - Source Files\node - Source Files\node - + Source Files\node Source Files\node - - Source Files\node - Source Files\node @@ -126,118 +141,49 @@ Source Files\node - - Source Files\control + + Source Files\ext\lz4 - - Source Files\control + + Source Files\ext\http-parser - - Source Files\control - - - Source Files\control - - - Source Files\osnet - - - Source Files\osnet - - - Source Files\osnet - - - Source Files\osnet - - - Source Files\testnet - - - Source Files\testnet - - - Source Files\testnet - - - Source Files\testnet - - - Source Files\testnet - - - Source Files - - - Source Files - - - Source Files - - - Source Files + + Source Files\ext\json-parser Header Files - - Header Files - - - Header Files - - - Header Files - Header Files - - Header Files\testnet - - - Header Files\testnet - - - Header Files\testnet - - - Header Files\testnet - - - Header Files\testnet - - - Header Files\testnet - Header Files\include - - Header Files\control + + Header Files\osdep - - Header Files\control + + Header Files\osdep - - Header Files\control + + Header Files\osdep - - Header Files\control + + Header Files\osdep - - Header Files\osnet + + Header Files\osdep - - Header Files\osnet + + Header Files\service - - Header Files\osnet + + Header Files\service - - Header Files\osnet + + Header Files\service Header Files\node @@ -275,15 +221,6 @@ Header Files\node - - Header Files\node - - - Header Files\node - - - Header Files\node - Header Files\node @@ -293,9 +230,6 @@ Header Files\node - - Header Files\node - Header Files\node @@ -314,10 +248,10 @@ Header Files\node - + Header Files\node - + Header Files\node @@ -338,16 +272,13 @@ Header Files\node - - Header Files\node - Header Files\node Header Files\node - + Header Files\node @@ -356,21 +287,9 @@ Header Files\node - - Header Files\node - - - Header Files\node - - - Header Files\node - Header Files\node - - Header Files\node - Header Files\node @@ -378,7 +297,13 @@ Header Files\node - Header Files + Header Files\ext\lz4 + + + Header Files\ext\json-parser + + + Header Files\ext\http-parser