]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Merge pull request #219 from marshmellow42/master
authorIceman <iceman@iuse.se>
Tue, 28 Feb 2017 07:00:00 +0000 (08:00 +0100)
committerGitHub <noreply@github.com>
Tue, 28 Feb 2017 07:00:00 +0000 (08:00 +0100)
em cleanup and fix bug in lf config [threshold] option making it not work...

client/whereami.c

index 289aeb1f419e37dc617e5639acd7e0b9e3692a9c..7c09894f512f46e0020d2a2bad247f55968c4bfa 100644 (file)
 extern "C" {
 #endif
 
+#if defined(__linux__)
+// make realpath() available:
+#define _DEFAULT_SOURCE
+#endif
+
 #if !defined(WAI_MALLOC) || !defined(WAI_FREE) || !defined(WAI_REALLOC)
 #include <stdlib.h>
 #endif
@@ -51,7 +56,7 @@ extern "C" {
 #pragma warning(push, 3)
 #endif
 #include <windows.h>
-#include <intrin.h>
+//#include <intrin.h>                  // not required and doesn't exist in old mingw environments
 #if defined(_MSC_VER)
 #pragma warning(pop)
 #endif
@@ -136,7 +141,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 +164,15 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
 
   return length;
 }
+ */
 
 #elif defined(__linux__)
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <limits.h>
+// #include <limits.h>     // not all linux distributions define PATH_MAX in limits.h because it depends on the filesystem. Therefore use...
+#include <linux/limits.h>
 #ifndef __STDC_FORMAT_MACROS
 #define __STDC_FORMAT_MACROS
 #endif
Impressum, Datenschutz