Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pthread related build busters in glog code. #866

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions libs/glog/glog-Natron.patch
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
diff -ur /Users/devernay/Development/blender/extern/glog/src/windows/port.h ./src/windows/port.h
--- /Users/devernay/Development/blender/extern/glog/src/windows/port.h 2016-03-21 18:40:14.000000000 +0100
+++ ./src/windows/port.h 2016-05-20 11:55:42.000000000 +0200
@@ -136,17 +136,22 @@
@@ -136,17 +136,23 @@
#endif // _MSC_VER

// ----------------------------------- THREADS
+#ifndef __MINGW32__ // MingW
+#if defined(HAVE_PTHREAD)
+# include <pthread.h>
+#else // no PTHREAD
typedef DWORD pthread_t;
typedef DWORD pthread_key_t;
typedef LONG pthread_once_t;
enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock
+#else
#define pthread_self GetCurrentThreadId
#define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
+#endif
+#endif // HAVE_PTHREAD

+#ifndef __MINGW32__ // MingW
inline struct tm* localtime_r(const time_t* timep, struct tm* result) {
Expand Down
7 changes: 4 additions & 3 deletions libs/glog/src/windows/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,16 @@ typedef int pid_t;
#endif // _MSC_VER

// ----------------------------------- THREADS
#ifndef __MINGW32__ // MingW
#if defined(HAVE_PTHREAD)
# include <pthread.h>
#else // no PTHREAD
typedef DWORD pthread_t;
typedef DWORD pthread_key_t;
typedef LONG pthread_once_t;
enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock
#else
#define pthread_self GetCurrentThreadId
#define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
#endif
#endif // HAVE_PTHREAD

#ifndef __MINGW32__ // MingW
inline struct tm* localtime_r(const time_t* timep, struct tm* result) {
Expand Down