Changeset View
Changeset View
Standalone View
Standalone View
src/util.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
#undef _WIN32_IE | #undef _WIN32_IE | ||||
#endif | #endif | ||||
#define _WIN32_IE 0x0501 | #define _WIN32_IE 0x0501 | ||||
#define WIN32_LEAN_AND_MEAN 1 | #define WIN32_LEAN_AND_MEAN 1 | ||||
#ifndef NOMINMAX | #ifndef NOMINMAX | ||||
#define NOMINMAX | #define NOMINMAX | ||||
#endif | #endif | ||||
#include <codecvt> | |||||
#include <io.h> /* for _commit */ | #include <io.h> /* for _commit */ | ||||
#include <shlobj.h> | #include <shlobj.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_SYS_PRCTL_H | #ifdef HAVE_SYS_PRCTL_H | ||||
#include <sys/prctl.h> | #include <sys/prctl.h> | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 1,000 Lines • ▼ Show 20 Lines | fs::path GetSpecialFolderPath(int nFolder, bool fCreate) { | ||||
return fs::path(""); | return fs::path(""); | ||||
} | } | ||||
#endif | #endif | ||||
void runCommand(const std::string &strCommand) { | void runCommand(const std::string &strCommand) { | ||||
if (strCommand.empty()) { | if (strCommand.empty()) { | ||||
return; | return; | ||||
} | } | ||||
#ifndef WIN32 | |||||
int nErr = ::system(strCommand.c_str()); | int nErr = ::system(strCommand.c_str()); | ||||
#else | |||||
int nErr = ::_wsystem( | |||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t>() | |||||
.from_bytes(strCommand) | |||||
.c_str()); | |||||
#endif | |||||
if (nErr) { | if (nErr) { | ||||
LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, | LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, | ||||
nErr); | nErr); | ||||
} | } | ||||
} | } | ||||
void RenameThread(const char *name) { | void RenameThread(const char *name) { | ||||
#if defined(PR_SET_NAME) | #if defined(PR_SET_NAME) | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |