From 81153cb16d1fdca895dc736b33ee54d47bd75760 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 14 Apr 2014 14:21:32 -0700 Subject: [PATCH] Fix code that breaks with VC (terrible compiler) VC2013 still does not properly support placement of variables anywhere in the scope. It's a garbage compiler, always will be a garbage compiler. --- libobs/util/threading.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libobs/util/threading.h b/libobs/util/threading.h index d48306b0c..4df01dafb 100644 --- a/libobs/util/threading.h +++ b/libobs/util/threading.h @@ -40,10 +40,10 @@ extern "C" { /* this may seem strange, but you can't use it unless it's an initializer */ static inline void pthread_mutex_init_value(pthread_mutex_t *mutex) { + pthread_mutex_t init_val = PTHREAD_MUTEX_INITIALIZER; if (!mutex) return; - pthread_mutex_t init_val = PTHREAD_MUTEX_INITIALIZER; *mutex = init_val; }