metadata
Wenzel Jakob 2013-12-08 02:42:00 +01:00
parent 5b0c09dbd0
commit 9f7363adab
3 changed files with 7 additions and 7 deletions

View File

@ -38,7 +38,7 @@ struct MemoryMappedFile::MemoryMappedFilePrivate {
Log(EError, "Could not map \"%s\" to memory!", filename.string().c_str()); Log(EError, "Could not map \"%s\" to memory!", filename.string().c_str());
if (close(fd) != 0) if (close(fd) != 0)
Log(EError, "close(): unable to close file!"); Log(EError, "close(): unable to close file!");
#elif defined(___WINDOWS__) #elif defined(__WINDOWS__)
file = CreateFile(filename.string().c_str(), GENERIC_WRITE | GENERIC_READ, file = CreateFile(filename.string().c_str(), GENERIC_WRITE | GENERIC_READ,
FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (file == INVALID_HANDLE_VALUE) if (file == INVALID_HANDLE_VALUE)

View File

@ -61,7 +61,7 @@ struct Plugin::PluginPrivate {
Plugin::Plugin(const std::string &shortName, const fs::path &path) Plugin::Plugin(const std::string &shortName, const fs::path &path)
: d(new PluginPrivate(shortName, path)) { : d(new PluginPrivate(shortName, path)) {
#if defined(___WINDOWS__) #if defined(__WINDOWS__)
d->handle = LoadLibraryW(path.c_str()); d->handle = LoadLibraryW(path.c_str());
if (!d->handle) { if (!d->handle) {
SLog(EError, "Error while loading plugin \"%s\": %s", SLog(EError, "Error while loading plugin \"%s\": %s",
@ -77,7 +77,7 @@ Plugin::Plugin(const std::string &shortName, const fs::path &path)
try { try {
d->getDescription = (GetDescriptionFunc) getSymbol("GetDescription"); d->getDescription = (GetDescriptionFunc) getSymbol("GetDescription");
} catch (...) { } catch (...) {
#if defined(___WINDOWS__) #if defined(__WINDOWS__)
FreeLibrary(d->handle); FreeLibrary(d->handle);
#else #else
dlclose(d->handle); dlclose(d->handle);
@ -102,7 +102,7 @@ Plugin::Plugin(const std::string &shortName, const fs::path &path)
} }
bool Plugin::hasSymbol(const std::string &sym) const { bool Plugin::hasSymbol(const std::string &sym) const {
#if defined(___WINDOWS__) #if defined(__WINDOWS__)
void *ptr = GetProcAddress(d->handle, sym.c_str()); void *ptr = GetProcAddress(d->handle, sym.c_str());
#else #else
void *ptr = dlsym(d->handle, sym.c_str()); void *ptr = dlsym(d->handle, sym.c_str());
@ -111,7 +111,7 @@ bool Plugin::hasSymbol(const std::string &sym) const {
} }
void *Plugin::getSymbol(const std::string &sym) { void *Plugin::getSymbol(const std::string &sym) {
#if defined(___WINDOWS__) #if defined(__WINDOWS__)
void *data = GetProcAddress(d->handle, sym.c_str()); void *data = GetProcAddress(d->handle, sym.c_str());
if (!data) { if (!data) {
SLog(EError, "Could not resolve symbol \"%s\" in \"%s\": %s", SLog(EError, "Could not resolve symbol \"%s\" in \"%s\": %s",
@ -152,7 +152,7 @@ const std::string& Plugin::getShortName() const {
} }
Plugin::~Plugin() { Plugin::~Plugin() {
#if defined(___WINDOWS__) #if defined(__WINDOWS__)
FreeLibrary(d->handle); FreeLibrary(d->handle);
#else #else
dlclose(d->handle); dlclose(d->handle);

View File

@ -473,7 +473,7 @@ void Random::State::init_by_array(const uint32_t *init_key, int key_length) {
Random::Random() : mt(NULL) { Random::Random() : mt(NULL) {
mt = (State *) allocAligned(sizeof(State)); mt = (State *) allocAligned(sizeof(State));
Assert(mt != NULL); Assert(mt != NULL);
#if defined(___WINDOWS__) #if defined(__WINDOWS__)
seed(); seed();
#else #else
#if 0 #if 0