Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/libmv/third_party/glog')
-rw-r--r--extern/libmv/third_party/glog/src/config.h2
-rw-r--r--extern/libmv/third_party/glog/src/utilities.h4
-rw-r--r--extern/libmv/third_party/glog/src/windows/glog/logging.h18
-rw-r--r--extern/libmv/third_party/glog/src/windows/port.h37
4 files changed, 50 insertions, 11 deletions
diff --git a/extern/libmv/third_party/glog/src/config.h b/extern/libmv/third_party/glog/src/config.h
index ed8d56e7799..06ed686f87c 100644
--- a/extern/libmv/third_party/glog/src/config.h
+++ b/extern/libmv/third_party/glog/src/config.h
@@ -4,6 +4,8 @@
/* Namespace for Google classes */
#ifdef __APPLE__
#include "config_mac.h"
+#elif __MINGW32__
+ #include "windows/config.h"
#elif __GNUC__
#include "config_linux.h"
#elif _MSC_VER
diff --git a/extern/libmv/third_party/glog/src/utilities.h b/extern/libmv/third_party/glog/src/utilities.h
index 2d4e99e595e..5c841a0b90b 100644
--- a/extern/libmv/third_party/glog/src/utilities.h
+++ b/extern/libmv/third_party/glog/src/utilities.h
@@ -101,7 +101,9 @@
// correctly when GetStackTrace() is called with max_depth == 0.
// Some code may do that.
-#if defined(HAVE_LIB_UNWIND)
+#if __MINGW32__
+# undef STACKTRACE_H
+#elif defined(HAVE_LIB_UNWIND)
# define STACKTRACE_H "stacktrace_libunwind-inl.h"
#elif !defined(NO_FRAME_POINTER)
# if defined(__i386__) && __GNUC__ >= 2
diff --git a/extern/libmv/third_party/glog/src/windows/glog/logging.h b/extern/libmv/third_party/glog/src/windows/glog/logging.h
index de51586f8e3..2f41681edbe 100644
--- a/extern/libmv/third_party/glog/src/windows/glog/logging.h
+++ b/extern/libmv/third_party/glog/src/windows/glog/logging.h
@@ -59,7 +59,7 @@
// Annoying stuff for windows -- makes sure clients can import these functions
#ifndef GOOGLE_GLOG_DLL_DECL
-# if defined(_WIN32) && !defined(__CYGWIN__)
+# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
# else
# define GOOGLE_GLOG_DLL_DECL
@@ -86,6 +86,15 @@
#include "third_party/gflags/gflags.h"
#endif
+#ifdef __MINGW32__
+# include <stdlib.h>
+# include <unistd.h>
+# include <stdint.h> // the normal place uint16_t is defined
+# include <sys/types.h> // the normal place u_int16_t is defined
+# include <inttypes.h> // a third place for uint16_t or u_int16_t
+# define _exit(x) exit(x)
+#endif
+
namespace google {
#if 0 // the C99 format
@@ -98,11 +107,16 @@ typedef int32_t int32;
typedef u_int32_t uint32;
typedef int64_t int64;
typedef u_int64_t uint64;
-#elif 1 // the windows (vc7) format
+#elif defined(_MSC_VER)
typedef __int32 int32;
typedef unsigned __int32 uint32;
typedef __int64 int64;
typedef unsigned __int64 uint64;
+#elif defined(__MINGW32__)
+typedef int32_t int32;
+typedef uint32_t uint32;
+typedef int64_t int64;
+typedef uint64_t uint64;
#else
#error Do not know how to define a 32-bit integer quantity on your system
#endif
diff --git a/extern/libmv/third_party/glog/src/windows/port.h b/extern/libmv/third_party/glog/src/windows/port.h
index d093bf5d34c..d5078120009 100644
--- a/extern/libmv/third_party/glog/src/windows/port.h
+++ b/extern/libmv/third_party/glog/src/windows/port.h
@@ -59,14 +59,16 @@
* used by both C and C++ code, so we put all the C++ together.
*/
-/* 4244: otherwise we get problems when substracting two size_t's to an int
- * 4251: it's complaining about a private struct I've chosen not to dllexport
- * 4355: we use this in a constructor, but we do it safely
- * 4715: for some reason VC++ stopped realizing you can't return after abort()
- * 4800: we know we're casting ints/char*'s to bools, and we're ok with that
- * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror()
- */
-#pragma warning(disable:4244 4251 4355 4715 4800 4996)
+#if _MSC_VER
+ /* 4244: otherwise we get problems when substracting two size_t's to an int
+ * 4251: it's complaining about a private struct I've chosen not to dllexport
+ * 4355: we use this in a constructor, but we do it safely
+ * 4715: for some reason VC++ stopped realizing you can't return after abort()
+ * 4800: we know we're casting ints/char*'s to bools, and we're ok with that
+ * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror()
+ */
+# pragma warning(disable:4244 4251 4355 4715 4800 4996)
+#endif
/* file I/O */
#define PATH_MAX 1024
@@ -108,7 +110,9 @@ extern int snprintf(char *str, size_t size,
extern int safe_vsnprintf(char *str, size_t size,
const char *format, va_list ap);
#define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap)
+#if !defined(__MINGW32__)
#define va_copy(dst, src) (dst) = (src)
+#endif
/* Windows doesn't support specifying the number of buckets as a
* hash_map constructor arg, so we leave this blank.
@@ -130,13 +134,30 @@ enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock
#define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
inline struct tm* localtime_r(const time_t* timep, struct tm* result) {
+#if __MINGW32__
+ struct tm *local_result;
+ local_result = localtime (timep);
+
+ if (local_result == NULL || result == NULL)
+ return NULL;
+
+ memcpy (result, local_result, sizeof (result));
+
+ return result;
+#else
localtime_s(result, timep);
return result;
+#endif
}
inline char* strerror_r(int errnum, char* buf, size_t buflen) {
+#if __MINGW32__
+ strncpy(buf, "Not implemented yet", buflen);
+ return buf;
+#else
strerror_s(buf, buflen, errnum);
return buf;
+#endif
}
#ifndef __cplusplus