summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
Diffstat (limited to 'osdep')
-rw-r--r--osdep/atomic.h19
-rw-r--r--osdep/mpv.rc2
-rw-r--r--osdep/windows_utils.c8
-rw-r--r--osdep/windows_utils.h4
4 files changed, 13 insertions, 20 deletions
diff --git a/osdep/atomic.h b/osdep/atomic.h
index 9028a504eb..50f4f403da 100644
--- a/osdep/atomic.h
+++ b/osdep/atomic.h
@@ -61,25 +61,6 @@ typedef struct { volatile unsigned long long v; } atomic_ullong;
__atomic_compare_exchange_n(&(a)->v, b, c, 0, __ATOMIC_SEQ_CST, \
__ATOMIC_SEQ_CST)
-#elif HAVE_SYNC_BUILTINS
-
-#define atomic_load(p) \
- __sync_fetch_and_add(&(p)->v, 0)
-#define atomic_store(p, val) \
- (__sync_synchronize(), (p)->v = (val), __sync_synchronize())
-#define atomic_fetch_add(a, b) \
- __sync_fetch_and_add(&(a)->v, b)
-#define atomic_fetch_and(a, b) \
- __sync_fetch_and_and(&(a)->v, b)
-#define atomic_fetch_or(a, b) \
- __sync_fetch_and_or(&(a)->v, b)
-// Assumes __sync_val_compare_and_swap is "strong" (using the C11 meaning).
-#define atomic_compare_exchange_strong(p, old, new) \
- ({ __typeof__((p)->v) val_ = __sync_val_compare_and_swap(&(p)->v, *(old), new); \
- bool ok_ = val_ == *(old); \
- if (!ok_) *(old) = val_; \
- ok_; })
-
#elif defined(__GNUC__)
#include <pthread.h>
diff --git a/osdep/mpv.rc b/osdep/mpv.rc
index 67c09f4f2c..8212437574 100644
--- a/osdep/mpv.rc
+++ b/osdep/mpv.rc
@@ -34,7 +34,7 @@ VS_VERSION_INFO VERSIONINFO
VALUE "CompanyName", "mpv"
VALUE "FileDescription", "mpv"
VALUE "FileVersion", "2.0.0.0"
- VALUE "LegalCopyright", "(C) 2000-2016 mpv/mplayer2/MPlayer"
+ VALUE "LegalCopyright", "(C) 2000-2017 mpv/mplayer2/MPlayer"
VALUE "OriginalFilename", "mpv.exe"
VALUE "ProductName", "mpv"
VALUE "ProductVersion", "2.0.0.0"
diff --git a/osdep/windows_utils.c b/osdep/windows_utils.c
index a1ea32191a..a60eba3d26 100644
--- a/osdep/windows_utils.c
+++ b/osdep/windows_utils.c
@@ -22,6 +22,7 @@
#include <errors.h>
#include <audioclient.h>
#include <d3d9.h>
+#include <dxgi1_2.h>
#include "windows_utils.h"
@@ -118,6 +119,13 @@ static char *hresult_to_str(const HRESULT hr)
E(D3DERR_CANNOTPROTECTCONTENT)
E(D3DERR_UNSUPPORTEDCRYPTO)
E(D3DERR_PRESENT_STATISTICS_DISJOINT)
+ E(DXGI_ERROR_DEVICE_HUNG)
+ E(DXGI_ERROR_DEVICE_REMOVED)
+ E(DXGI_ERROR_DEVICE_RESET)
+ E(DXGI_ERROR_DRIVER_INTERNAL_ERROR)
+ E(DXGI_ERROR_INVALID_CALL)
+ E(DXGI_ERROR_WAS_STILL_DRAWING)
+ E(DXGI_STATUS_OCCLUDED)
default:
return "<Unknown>";
}
diff --git a/osdep/windows_utils.h b/osdep/windows_utils.h
index 6c750ded2a..a20a558709 100644
--- a/osdep/windows_utils.h
+++ b/osdep/windows_utils.h
@@ -20,6 +20,10 @@
#include <windows.h>
+// Conditionally release a COM interface and set the pointer to NULL
+#define SAFE_RELEASE(u) \
+ do { if ((u) != NULL) (u)->lpVtbl->Release(u); (u) = NULL; } while(0)
+
char *mp_GUID_to_str_buf(char *buf, size_t buf_size, const GUID *guid);
#define mp_GUID_to_str(guid) mp_GUID_to_str_buf((char[40]){0}, 40, (guid))
char *mp_HRESULT_to_str_buf(char *buf, size_t buf_size, HRESULT hr);