summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-03-04 15:25:58 +0100
committerRobin Gareus <robin@gareus.org>2014-03-04 15:25:58 +0100
commit912f07b919c1ec44f0cdd5278d74a9bc29b91846 (patch)
tree1cd5f158ada5e8b9b73cf0d52ca5f9fa430c1fe9 /libs/pbd/pbd
parent3e250d5f0649256c8e4c7c53da4f67383dd52f78 (diff)
mingw build fixes (tested with i686-w64-mingw32 on linux-x86_64)
Diffstat (limited to 'libs/pbd/pbd')
-rw-r--r--libs/pbd/pbd/abstract_ui.h2
-rw-r--r--libs/pbd/pbd/localtime_r.h21
-rw-r--r--libs/pbd/pbd/system_exec.h2
3 files changed, 18 insertions, 7 deletions
diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h
index dc5620b2ef..04d0a38e85 100644
--- a/libs/pbd/pbd/abstract_ui.h
+++ b/libs/pbd/pbd/abstract_ui.h
@@ -75,7 +75,7 @@ class ABSTRACT_UI_API AbstractUI : public BaseUI
};
typedef typename RequestBuffer::rw_vector RequestBufferVector;
-#if defined(__MINGW32__) && !defined (__MINGW64__)
+#ifdef COMPILER_MSVC // ?? (not needed for ming32 nor mingw64)
struct pthread_cmp
{
diff --git a/libs/pbd/pbd/localtime_r.h b/libs/pbd/pbd/localtime_r.h
index ad5b89d134..1e810ec084 100644
--- a/libs/pbd/pbd/localtime_r.h
+++ b/libs/pbd/pbd/localtime_r.h
@@ -3,11 +3,22 @@
#include <time.h>
#ifdef COMPILER_MSVC
- #define localtime_r( _clock, _result ) \
- ( *(_result) = *localtime( (_clock) ), \
- (_result) )
-#else
- extern struct tm *localtime_r(const time_t *const timep, struct tm *p_tm);
+
+#define localtime_r( _clock, _result ) \
+ ( *(_result) = *localtime( (_clock) ), (_result) )
+
+#elif defined __MINGW64__
+
+# ifdef (localtime_r)
+# undef localtime_r
+# endif
+
+// As in 64 bit time_t is 64 bit integer, compiler breaks compilation
+// everytime implicit cast from long int* to time_t* worked in
+// the past (32 bit). To unblock such a cast we added the localtime below:
+extern struct tm *localtime(const long int *_Time);
+extern struct tm *localtime_r(const time_t *const timep, struct tm *p_tm);
+
#endif
#endif
diff --git a/libs/pbd/pbd/system_exec.h b/libs/pbd/pbd/system_exec.h
index f08191654d..0ca523085a 100644
--- a/libs/pbd/pbd/system_exec.h
+++ b/libs/pbd/pbd/system_exec.h
@@ -30,7 +30,7 @@
#define STDERR_FILENO 2
#endif
-#if defined (__MINGW64__)
+#ifdef PLATFORM_WINDOWS
#include <windows.h>
#ifdef interface