Browse Source

fix windows build, add windows GetDefaultDataDir, add files to project

pull/31/head
chertov 11 years ago
parent
commit
dbd9c5c105
  1. 1
      Streaming.cpp
  2. 4
      Win32/i2pd.vcxproj
  3. 12
      Win32/i2pd.vcxproj.filters
  4. 10
      util.cpp

1
Streaming.cpp

@ -2,6 +2,7 @@
#include <algorithm> #include <algorithm>
#include <cryptopp/gzip.h> #include <cryptopp/gzip.h>
#include "Log.h" #include "Log.h"
#include "I2PEndian.h"
#include "RouterInfo.h" #include "RouterInfo.h"
#include "RouterContext.h" #include "RouterContext.h"
#include "Tunnel.h" #include "Tunnel.h"

4
Win32/i2pd.vcxproj

@ -22,6 +22,7 @@
<ClCompile Include="..\Log.cpp" /> <ClCompile Include="..\Log.cpp" />
<ClCompile Include="..\NetDb.cpp" /> <ClCompile Include="..\NetDb.cpp" />
<ClCompile Include="..\NTCPSession.cpp" /> <ClCompile Include="..\NTCPSession.cpp" />
<ClCompile Include="..\Reseed.cpp" />
<ClCompile Include="..\RouterContext.cpp" /> <ClCompile Include="..\RouterContext.cpp" />
<ClCompile Include="..\RouterInfo.cpp" /> <ClCompile Include="..\RouterInfo.cpp" />
<ClCompile Include="..\SSU.cpp" /> <ClCompile Include="..\SSU.cpp" />
@ -31,6 +32,7 @@
<ClCompile Include="..\Tunnel.cpp" /> <ClCompile Include="..\Tunnel.cpp" />
<ClCompile Include="..\TunnelEndpoint.cpp" /> <ClCompile Include="..\TunnelEndpoint.cpp" />
<ClCompile Include="..\TunnelGateway.cpp" /> <ClCompile Include="..\TunnelGateway.cpp" />
<ClCompile Include="..\util.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\base64.h" /> <ClInclude Include="..\base64.h" />
@ -47,6 +49,7 @@
<ClInclude Include="..\NetDb.h" /> <ClInclude Include="..\NetDb.h" />
<ClInclude Include="..\NTCPSession.h" /> <ClInclude Include="..\NTCPSession.h" />
<ClInclude Include="..\Queue.h" /> <ClInclude Include="..\Queue.h" />
<ClInclude Include="..\Reseed.h" />
<ClInclude Include="..\RouterContext.h" /> <ClInclude Include="..\RouterContext.h" />
<ClInclude Include="..\RouterInfo.h" /> <ClInclude Include="..\RouterInfo.h" />
<ClInclude Include="..\SSU.h" /> <ClInclude Include="..\SSU.h" />
@ -59,6 +62,7 @@
<ClInclude Include="..\TunnelConfig.h" /> <ClInclude Include="..\TunnelConfig.h" />
<ClInclude Include="..\TunnelEndpoint.h" /> <ClInclude Include="..\TunnelEndpoint.h" />
<ClInclude Include="..\TunnelGateway.h" /> <ClInclude Include="..\TunnelGateway.h" />
<ClInclude Include="..\util.h" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{930568EC-31C9-406A-AD1C-9636DF5D8FAA}</ProjectGuid> <ProjectGuid>{930568EC-31C9-406A-AD1C-9636DF5D8FAA}</ProjectGuid>

12
Win32/i2pd.vcxproj.filters

@ -75,6 +75,12 @@
<ClCompile Include="..\SSU.cpp"> <ClCompile Include="..\SSU.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Reseed.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\Identity.h"> <ClInclude Include="..\Identity.h">
@ -155,5 +161,11 @@
<ClInclude Include="..\SSU.h"> <ClInclude Include="..\SSU.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\Reseed.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

10
util.cpp

@ -10,9 +10,15 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/program_options/detail/config_file.hpp> #include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/parsers.hpp> #include <boost/program_options/parsers.hpp>
#include <boost/algorithm/string.hpp>
#include "util.h" #include "util.h"
#include "Log.h" #include "Log.h"
#ifdef WIN32
#include <Windows.h>
#include <shlobj.h>
#endif
namespace i2p namespace i2p
{ {
namespace util namespace util
@ -152,7 +158,9 @@ namespace filesystem
// Unix: ~/.i2pd // Unix: ~/.i2pd
#ifdef WIN32 #ifdef WIN32
// Windows // Windows
return GetSpecialFolderPath(CSIDL_APPDATA) / "i2pd"; char localAppData[MAX_PATH];
SHGetFolderPath(NULL, CSIDL_APPDATA, 0, NULL, localAppData);
return boost::filesystem::path(std::string(localAppData) + "\\i2pd");
#else #else
boost::filesystem::path pathRet; boost::filesystem::path pathRet;
char* pszHome = getenv("HOME"); char* pszHome = getenv("HOME");

Loading…
Cancel
Save