osdep: remove atomic.h

replace it with <stdatomic.h> and replace the mp_atomic_* typedefs with
explicit _Atomic qualified types.

also add missing config.h includes on some files.
This commit is contained in:
NRK 2023-10-19 18:18:52 +06:00 committed by sfan5
parent 2fa695c3f9
commit 2070331f64
28 changed files with 33 additions and 60 deletions

View File

@ -20,6 +20,8 @@
#include <AudioToolbox/AudioToolbox.h>
#include "config.h"
struct mp_chmap;
int ca_label_to_mp_speaker_id(AudioChannelLabel label);

View File

@ -43,7 +43,7 @@
#include "internal.h"
#include "audio/format.h"
#include "osdep/timer.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "options/m_option.h"
#include "common/msg.h"
#include "audio/out/ao_coreaudio_chmap.h"

View File

@ -22,6 +22,8 @@
#include <AudioToolbox/AudioToolbox.h>
#include <inttypes.h>
#include <stdbool.h>
#include "config.h"
#include "common/msg.h"
#include "audio/out/ao.h"
#include "internal.h"

View File

@ -33,7 +33,7 @@
#include "ao.h"
#include "internal.h"
#include "audio/format.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/timer.h"
#include "options/m_config.h"
#include "options/m_option.h"

View File

@ -29,7 +29,7 @@
#include <endpointvolume.h>
#include "common/msg.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/windows_utils.h"
#include "internal.h"
#include "ao.h"

View File

@ -21,7 +21,7 @@
#include <stdbool.h>
#include <pthread.h>
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "audio/out/ao.h"
/* global data used by ao.c and ao drivers */
@ -63,7 +63,7 @@ struct ao {
atomic_uint events_;
// Float gain multiplicator
mp_atomic_float gain;
_Atomic float gain;
int buffer;
double def_buffer;

View File

@ -27,7 +27,7 @@
#include "mpv_talloc.h"
#include "misc/bstr.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "common/common.h"
#include "common/global.h"
#include "misc/bstr.h"

View File

@ -8,7 +8,7 @@
#include "misc/node.h"
#include "msg.h"
#include "options/m_option.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/timer.h"
#include "stats.h"

View File

@ -42,7 +42,7 @@
#include "common/stats.h"
#include "misc/charset_conv.h"
#include "misc/thread_tools.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/timer.h"
#include "osdep/threads.h"

View File

@ -4,7 +4,7 @@
#include "audio/aframe.h"
#include "common/common.h"
#include "common/msg.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "f_async_queue.h"
#include "filter_internal.h"
@ -16,7 +16,7 @@ struct mp_async_queue {
};
struct async_queue {
mp_atomic_uint64 refcount;
_Atomic uint64_t refcount;
pthread_mutex_t lock;

View File

@ -6,7 +6,7 @@
#include "common/common.h"
#include "common/global.h"
#include "common/msg.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/timer.h"
#include "video/hwdec.h"
#include "video/img_format.h"

View File

@ -27,7 +27,7 @@
#include "common/common.h"
#include "misc/linked_list.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/io.h"
#include "osdep/timer.h"

View File

@ -31,13 +31,13 @@
#include "common/msg.h"
#include "common/msg_control.h"
#include "misc/dispatch.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
// For use with m_config_cache.
struct m_config_shadow {
pthread_mutex_t lock;
// Incremented on every option change.
mp_atomic_uint64 ts;
_Atomic uint64_t ts;
// -- immutable after init
// List of m_sub_options instances.
// Index 0 is the top-level and is always present.

View File

@ -36,7 +36,7 @@
#include "common/msg_control.h"
#include "misc/dispatch.h"
#include "misc/node.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
extern const char mp_help_text[];

View File

@ -29,7 +29,7 @@
#include "misc/bstr.h"
#include "misc/dispatch.h"
#include "options/m_option.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
// m_config provides an API to manipulate the config variables in MPlayer.
// It makes use of the Options API to provide a context stack that

View File

@ -1,31 +0,0 @@
/*
* This file is part of mpv.
* Copyright (c) 2013 Stefano Pigozzi <stefano.pigozzi@gmail.com>
*
* mpv is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* mpv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MP_ATOMIC_H
#define MP_ATOMIC_H
#include <inttypes.h>
#include "config.h"
#include <stdatomic.h>
typedef _Atomic float mp_atomic_float;
typedef _Atomic double mp_atomic_double;
typedef _Atomic int64_t mp_atomic_int64;
typedef _Atomic uint64_t mp_atomic_uint64;
#endif

View File

@ -25,7 +25,7 @@
#include <dxgi1_2.h>
#include "common/common.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "windows_utils.h"
char *mp_GUID_to_str_buf(char *buf, size_t buf_size, const GUID *guid)

View File

@ -39,7 +39,7 @@
#include "options/m_property.h"
#include "options/path.h"
#include "options/parse_configfile.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/threads.h"
#include "osdep/timer.h"
#include "osdep/io.h"

View File

@ -21,7 +21,7 @@
#include <pthread.h>
#include <stdbool.h>
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "libmpv/client.h"

View File

@ -3,7 +3,7 @@
#include <pthread.h>
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osd.h"
enum mp_osdtype {
@ -71,7 +71,7 @@ struct osd_state {
struct osd_object *objs[MAX_OSD_PARTS];
bool render_subs_in_filter;
mp_atomic_double force_video_pts;
_Atomic double force_video_pts;
bool want_redraw;
bool want_redraw_notification;

View File

@ -30,7 +30,7 @@
#import "video/out/cocoa/mpvadapter.h"
#include "osdep/threads.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/macosx_compat.h"
#include "osdep/macosx_events_objc.h"

View File

@ -6,7 +6,7 @@
#include "mpv_talloc.h"
#include "misc/dispatch.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "video/mp_image.h"
#include "dr_helper.h"

View File

@ -24,7 +24,7 @@
#include <EGL/eglext.h>
#include "common/common.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "video/out/win_state.h"
#include "context.h"
#include "egl_helpers.h"

View File

@ -26,7 +26,7 @@
#include "mpv_talloc.h"
#include "config.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/timer.h"
#include "osdep/threads.h"
#include "misc/dispatch.h"

View File

@ -19,7 +19,7 @@
#include "vo.h"
#include "video/mp_image.h"
#include "sub/osd.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/timer.h"
#include "common/global.h"

View File

@ -42,7 +42,7 @@
#include "osdep/io.h"
#include "osdep/threads.h"
#include "osdep/w32_keyboard.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "misc/dispatch.h"
#include "misc/rendezvous.h"
#include "mpv_talloc.h"

View File

@ -23,7 +23,7 @@
#include "common/common.h"
#include "input/input.h"
#include "input/event.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "osdep/io.h"
#include "osdep/windows_utils.h"
#include "mpv_talloc.h"

View File

@ -24,7 +24,7 @@
#include <X11/Xutil.h>
#include "common/common.h"
#include "osdep/atomic.h"
#include <stdatomic.h>
#include "config.h"
#if !HAVE_GPL