Browse Source

Merge pull request #1332 from Diapolo/fix_RenameOver_FileCommit_Win32

fix RenameOver() and FileCommit() functions, to not generate compilation errors
pull/1/head
Jeff Garzik 11 years ago
parent
commit
0c7fd94585
  1. 4
      src/main.h
  2. 3
      src/util.cpp

4
src/main.h

@ -10,10 +10,6 @@ @@ -10,10 +10,6 @@
#include "net.h"
#include "script.h"
#ifdef WIN32
#include <io.h> /* for _commit */
#endif
#include <list>
class CWallet;

3
src/util.cpp

@ -47,6 +47,7 @@ namespace boost { @@ -47,6 +47,7 @@ namespace boost {
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <io.h> /* for _commit */
#include "shlobj.h"
#endif
@ -913,7 +914,7 @@ void CreatePidFile(const boost::filesystem::path &path, pid_t pid) @@ -913,7 +914,7 @@ void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
{
#ifdef WIN32
return MoveFileEx(src.string().c_str(), dest.string().c_str(),
return MoveFileExA(src.string().c_str(), dest.string().c_str(),
MOVEFILE_REPLACE_EXISTING);
#else
int rc = std::rename(src.string().c_str(), dest.string().c_str());

Loading…
Cancel
Save