summaryrefslogtreecommitdiffstats
path: root/common/msg.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-05 17:02:06 +0200
committerwm4 <wm4@nowhere>2014-07-05 17:07:16 +0200
commitd27a2bc546a2ba8dcb69931c9a1f7b60a1b95b03 (patch)
treee5a89781003abbc43c72f7387ca9f0146b34048b /common/msg.c
parent49df0355148e268a2afbc35f351e3adc05fc22d8 (diff)
downloadmpv-d27a2bc546a2ba8dcb69931c9a1f7b60a1b95b03.tar.bz2
mpv-d27a2bc546a2ba8dcb69931c9a1f7b60a1b95b03.tar.xz
build: allow compilation without any atomics
Not all compilers on all platforms have atomics available (even if they could, technically speaking). We don't use atomics that much, only the following things rely on it: 1. the audio pull code, and all audio outputs using it 2. updating global msg levels 3. reading log messages through the client API Just disable 1. and 3. if atomics are not available. For 2., using fake- atomics isn't too bad; at worst, message levels won't properly update under certain situations (but most likely, it will work just fine). This means if atomics are not available, the client API function mpv_request_log_messages() will do nothing. CC: @mpv-player/stable
Diffstat (limited to 'common/msg.c')
-rw-r--r--common/msg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/msg.c b/common/msg.c
index 9b05e55660..4f9bd886a5 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -469,6 +469,10 @@ struct mp_log_buffer *mp_msg_log_buffer_new(struct mpv_global *global,
{
struct mp_log_root *root = global->log->root;
+#if !HAVE_ATOMICS
+ return NULL;
+#endif
+
pthread_mutex_lock(&mp_msg_lock);
struct mp_log_buffer *buffer = talloc_ptrtype(NULL, buffer);