mirror of
https://github.com/cygnusxi/CurecoinSource.git
synced 2025-07-27 15:44:25 +02:00
fixed windows-related compilation issues; fixed ipv6 issues
This commit is contained in:
parent
d721c6f1fd
commit
a906f48b04
@ -25,12 +25,13 @@
|
||||
#include <ifaddrs.h>
|
||||
#endif
|
||||
|
||||
typedef u_int SOCKET;
|
||||
|
||||
#ifdef WIN32
|
||||
#define MSG_NOSIGNAL 0
|
||||
#define MSG_DONTWAIT 0
|
||||
typedef int socklen_t;
|
||||
#else
|
||||
typedef u_int SOCKET;
|
||||
#include "errno.h"
|
||||
#define WSAGetLastError() errno
|
||||
#define WSAEINVAL EINVAL
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "ui_interface.h"
|
||||
#include "kernel.h"
|
||||
#include "wallet.h"
|
||||
#include "util.h"
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
|
@ -1738,14 +1738,17 @@ bool BindListenPort(const CService &addrBind, std::string& strError)
|
||||
// some systems don't have IPV6_V6ONLY but are always v6only; others do have the option
|
||||
// and enable it by default or not. Try to enable it, if possible.
|
||||
if (addrBind.IsIPv6()) {
|
||||
#ifndef WIN32
|
||||
#ifdef IPV6_V6ONLY
|
||||
setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&nOne, sizeof(int));
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#else
|
||||
int nProtLevel = 10 /* PROTECTION_LEVEL_UNRESTRICTED */;
|
||||
int nParameterId = 23 /* IPV6_PROTECTION_LEVEl */;
|
||||
// this call is allowed to fail
|
||||
#ifdef IPV6_V6ONLY
|
||||
setsockopt(hListenSocket, IPPROTO_IPV6, nParameterId, (const char*)&nProtLevel, sizeof(int));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -67,7 +67,6 @@ namespace boost {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
std::map<std::string, std::string> mapArgs;
|
||||
std::map<std::string, std::vector<std::string> > mapMultiArgs;
|
||||
bool fDebug = false;
|
||||
@ -1114,7 +1113,7 @@ boost::filesystem::path GetPidFile()
|
||||
return pathPidFile;
|
||||
}
|
||||
|
||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
|
||||
void CreatePidFile(const boost::filesystem::path &path, util_pid_t pid)
|
||||
{
|
||||
FILE* file = fopen(path.string().c_str(), "w");
|
||||
if (file)
|
||||
|
@ -12,7 +12,8 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#else
|
||||
typedef int pid_t; /* define for Windows compatibility */
|
||||
#include <processthreadsapi.h>
|
||||
typedef int util_pid_t; /* define for Windows compatibility */
|
||||
#endif
|
||||
#include <map>
|
||||
#include <vector>
|
||||
@ -29,6 +30,7 @@ typedef int pid_t; /* define for Windows compatibility */
|
||||
|
||||
#include "netbase.h" // for AddTimeData
|
||||
|
||||
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
|
||||
@ -215,7 +217,7 @@ boost::filesystem::path GetDefaultDataDir();
|
||||
const boost::filesystem::path &GetDataDir(bool fNetSpecific = true);
|
||||
boost::filesystem::path GetConfigFile();
|
||||
boost::filesystem::path GetPidFile();
|
||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
|
||||
void CreatePidFile(const boost::filesystem::path &path, util_pid_t pid);
|
||||
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
||||
#ifdef WIN32
|
||||
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user