From 5a6a7affc50e3e85c02c2da63b2f85803790f36f Mon Sep 17 00:00:00 2001 From: pwpiwi Date: Fri, 24 Feb 2017 16:19:35 +0100 Subject: [PATCH] Fix issues with commit 4197a3f on some linux distributions and old mingw environments (issue #217) --- client/whereami.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/whereami.c b/client/whereami.c index 289aeb1f..021ad874 100644 --- a/client/whereami.c +++ b/client/whereami.c @@ -51,7 +51,7 @@ extern "C" { #pragma warning(push, 3) #endif #include -#include +//#include // not required and doesn't exist in old mingw environments #if defined(_MSC_VER) #pragma warning(pop) #endif @@ -136,7 +136,9 @@ int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) return WAI_PREFIX(getModulePath_)(NULL, out, capacity, dirname_length); } -WAI_NOINLINE +// GetModuleHandleEx() is not available on old mingw environments. We don't need getModulePath() yet. +// Sacrifice it for the time being to improve backwards compatibility +/* WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { @@ -157,13 +159,15 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) return length; } + */ #elif defined(__linux__) #include #include #include -#include +// #include // not all linux distributions define PATH_MAX in limits.h because it depends on the filesystem. Therefore use... +#include #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif -- 2.39.2