summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorMartin Herkt <lachs0r@srsfckn.biz>2016-08-15 15:19:29 +0200
committerMartin Herkt <lachs0r@srsfckn.biz>2016-08-15 15:19:29 +0200
commitfd1bc95b4865ff789780c2213eefbdf77f0d4d1f (patch)
tree639e098e46cf1b77ecea7df95d7b968c25e1d0c9 /osdep
parent1e00bcc14c9b0d9beb8e152f958fc0db4bc6d31b (diff)
parentd7a7e9a8c861c4a9881fcef5cf69c746742b8b88 (diff)
downloadmpv-fd1bc95b4865ff789780c2213eefbdf77f0d4d1f.tar.bz2
mpv-fd1bc95b4865ff789780c2213eefbdf77f0d4d1f.tar.xz
Merge branch 'master' into release/current
Diffstat (limited to 'osdep')
-rw-r--r--osdep/atomics.h29
-rw-r--r--osdep/io.c8
-rw-r--r--osdep/io.h1
-rw-r--r--osdep/macosx_application.m2
-rw-r--r--osdep/mpv.rc32
5 files changed, 43 insertions, 29 deletions
diff --git a/osdep/atomics.h b/osdep/atomics.h
index c4f31286cc..bfcaa38977 100644
--- a/osdep/atomics.h
+++ b/osdep/atomics.h
@@ -28,15 +28,14 @@
// Emulate the parts of C11 stdatomic.h needed by mpv.
// Still relies on gcc/clang atomic builtins.
-// The t field is a hack to make the non-atomic fallback macro mess work.
-typedef struct { volatile unsigned long v, t; } atomic_ulong;
-typedef struct { volatile int v, t; } atomic_int;
-typedef struct { volatile unsigned int v, t; } atomic_uint;
-typedef struct { volatile _Bool v, t; } atomic_bool;
-typedef struct { volatile long long v, t; } atomic_llong;
-typedef struct { volatile uint_least32_t v, t; } atomic_uint_least32_t;
-typedef struct { volatile unsigned long long v, t; } atomic_ullong;
+typedef struct { volatile unsigned long v; } atomic_ulong;
+typedef struct { volatile int v; } atomic_int;
+typedef struct { volatile unsigned int v; } atomic_uint;
+typedef struct { volatile _Bool v; } atomic_bool;
+typedef struct { volatile long long v; } atomic_llong;
+typedef struct { volatile uint_least32_t v; } atomic_uint_least32_t;
+typedef struct { volatile unsigned long long v; } atomic_ullong;
#define ATOMIC_VAR_INIT(x) \
{.v = (x)}
@@ -82,19 +81,7 @@ typedef struct { volatile unsigned long long v, t; } atomic_ullong;
ok_; })
#else
-
-// This is extremely wrong. The build system actually disables code that has
-// a serious dependency on working atomics, so this is barely ok.
-#define atomic_load(p) ((p)->v)
-#define atomic_store(p, val) ((p)->v = (val))
-#define atomic_fetch_op_(a, b, op) \
- ((a)->t = (a)->v, (a)->v = (a)->v op (b), (a)->t)
-#define atomic_fetch_add(a, b) atomic_fetch_op_(a, b, +)
-#define atomic_fetch_and(a, b) atomic_fetch_op_(a, b, &)
-#define atomic_fetch_or(a, b) atomic_fetch_op_(a, b, |)
-#define atomic_compare_exchange_strong(p, old, new) \
- ((p)->v == *(old) ? ((p)->v = (new), 1) : (*(old) = (p)->v, 0))
-
+# error "this should have been a configuration error, report a bug please"
#endif /* no atomics */
#endif /* else HAVE_STDATOMIC */
diff --git a/osdep/io.c b/osdep/io.c
index 5952f21980..26889189cf 100644
--- a/osdep/io.c
+++ b/osdep/io.c
@@ -85,6 +85,14 @@ int mp_make_wakeup_pipe(int pipes[2])
}
#endif
+void mp_flush_wakeup_pipe(int pipe_end)
+{
+#ifndef __MINGW32__
+ char buf[100];
+ (void)read(pipe_end, buf, sizeof(buf));
+#endif
+}
+
#ifdef _WIN32
#include <windows.h>
diff --git a/osdep/io.h b/osdep/io.h
index 541e36aeea..333ed4f808 100644
--- a/osdep/io.h
+++ b/osdep/io.h
@@ -47,6 +47,7 @@
bool mp_set_cloexec(int fd);
int mp_make_cloexec_pipe(int pipes[2]);
int mp_make_wakeup_pipe(int pipes[2]);
+void mp_flush_wakeup_pipe(int pipe_end);
#ifdef _WIN32
#include <wchar.h>
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m
index 21d57b497d..bf415d9576 100644
--- a/osdep/macosx_application.m
+++ b/osdep/macosx_application.m
@@ -161,7 +161,7 @@ static void terminate_cocoa_application(void)
- (void)stopPlaybackAndRememberPosition
{
- [self stopMPV:"quit_watch_later"];
+ [self stopMPV:"quit-watch-later"];
}
- (void)stopMPV:(char *)cmd
diff --git a/osdep/mpv.rc b/osdep/mpv.rc
index 638d020b36..67c09f4f2c 100644
--- a/osdep/mpv.rc
+++ b/osdep/mpv.rc
@@ -19,13 +19,31 @@
#include <winver.h>
-1 VERSIONINFO
-FILEVERSION 2,0,0,0
-PRODUCTVERSION 2,0,0,0
-FILEOS VOS__WINDOWS32
-FILETYPE VFT_APP
-{
-}
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 2, 0, 0, 0
+ PRODUCTVERSION 2, 0, 0, 0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE 0
+ {
+ BLOCK "StringFileInfo" {
+ BLOCK "000004b0" {
+ VALUE "Comments", "mpv is distributed under the terms of the GNU General Public License Version 2 or later."
+ VALUE "CompanyName", "mpv"
+ VALUE "FileDescription", "mpv"
+ VALUE "FileVersion", "2.0.0.0"
+ VALUE "LegalCopyright", "(C) 2000-2016 mpv/mplayer2/MPlayer"
+ VALUE "OriginalFilename", "mpv.exe"
+ VALUE "ProductName", "mpv"
+ VALUE "ProductVersion", "2.0.0.0"
+ }
+ }
+ BLOCK "VarFileInfo" {
+ VALUE "Translation", 0, 1200
+ }
+ }
IDI_ICON1 ICON DISCARDABLE "etc/mpv-icon.ico"