From 4280d4b359d2ee156752ea0da568e2743d823f3c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 23 Oct 2023 17:04:14 -0700 Subject: [PATCH] Fixed warning C4210: nonstandard extension used: function given file scope Resurrected SDL_audio_c.h, we knew it would be back... --- VisualC-GDK/SDL/SDL.vcxproj | 1 + VisualC-GDK/SDL/SDL.vcxproj.filters | 3 +++ VisualC-WinRT/SDL-UWP.vcxproj | 1 + VisualC-WinRT/SDL-UWP.vcxproj.filters | 3 +++ VisualC/SDL/SDL.vcxproj | 1 + VisualC/SDL/SDL.vcxproj.filters | 3 +++ Xcode/SDL/SDL.xcodeproj/project.pbxproj | 4 ++++ src/audio/SDL_audio_c.h | 27 +++++++++++++++++++++++++ src/events/SDL_events.c | 2 +- 9 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/audio/SDL_audio_c.h diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index 565362dbd..bb003d0f0 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -367,6 +367,7 @@ + diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 3ebac004e..bbdc75985 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -411,6 +411,9 @@ API Headers + + audio + audio diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj index f6c11b5a5..372a28339 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj +++ b/VisualC-WinRT/SDL-UWP.vcxproj @@ -93,6 +93,7 @@ + diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters index f6aee5712..92e6f4a8d 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj.filters +++ b/VisualC-WinRT/SDL-UWP.vcxproj.filters @@ -177,6 +177,9 @@ Source Files + + Source Files + Source Files diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index 219e93ed3..a40d5acb5 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -317,6 +317,7 @@ + diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index 5dd954cf2..f72a3a0fc 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -402,6 +402,9 @@ API Headers + + audio + audio diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 2fb3aca92..279a74856 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -238,6 +238,7 @@ A7D8B76A23E2514300DCD162 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A86623E2513F00DCD162 /* SDL_wave.c */; }; A7D8B79423E2514400DCD162 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A87123E2513F00DCD162 /* SDL_dummyaudio.h */; }; A7D8B79A23E2514400DCD162 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A87223E2513F00DCD162 /* SDL_dummyaudio.c */; }; + A7D8B7A023E2514400DCD162 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A87323E2513F00DCD162 /* SDL_audio_c.h */; }; A7D8B7B223E2514400DCD162 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A87723E2513F00DCD162 /* SDL_audiodev_c.h */; }; A7D8B81823E2514400DCD162 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A88F23E2513F00DCD162 /* SDL_audiodev.c */; }; A7D8B85A23E2514400DCD162 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A89F23E2513F00DCD162 /* SDL_sysaudio.h */; }; @@ -746,6 +747,7 @@ A7D8A86623E2513F00DCD162 /* SDL_wave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_wave.c; sourceTree = ""; }; A7D8A87123E2513F00DCD162 /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = ""; }; A7D8A87223E2513F00DCD162 /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = ""; }; + A7D8A87323E2513F00DCD162 /* SDL_audio_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_c.h; sourceTree = ""; }; A7D8A87723E2513F00DCD162 /* SDL_audiodev_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiodev_c.h; sourceTree = ""; }; A7D8A88F23E2513F00DCD162 /* SDL_audiodev.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiodev.c; sourceTree = ""; }; A7D8A89F23E2513F00DCD162 /* SDL_sysaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysaudio.h; sourceTree = ""; }; @@ -1813,6 +1815,7 @@ A7D8A8B923E2513F00DCD162 /* coreaudio */, A7D8A8AF23E2513F00DCD162 /* disk */, A7D8A87023E2513F00DCD162 /* dummy */, + A7D8A87323E2513F00DCD162 /* SDL_audio_c.h */, F32DDAC92AB795A30041EAA5 /* SDL_audio_channel_converters.h */, F32DDACC2AB795A30041EAA5 /* SDL_audio_resampler_filter.h */, A7D8A8B823E2513F00DCD162 /* SDL_audio.c */, @@ -2068,6 +2071,7 @@ A7D8B61723E2514300DCD162 /* SDL_assert_c.h in Headers */, F3F7D9292933074E00816151 /* SDL_atomic.h in Headers */, F3F7D8ED2933074E00816151 /* SDL_audio.h in Headers */, + A7D8B7A023E2514400DCD162 /* SDL_audio_c.h in Headers */, A7D8B7B223E2514400DCD162 /* SDL_audiodev_c.h in Headers */, F3F7D9E12933074E00816151 /* SDL_begin_code.h in Headers */, F3F7D9A52933074E00816151 /* SDL_bits.h in Headers */, diff --git a/src/audio/SDL_audio_c.h b/src/audio/SDL_audio_c.h new file mode 100644 index 000000000..949d9e6c6 --- /dev/null +++ b/src/audio/SDL_audio_c.h @@ -0,0 +1,27 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_audio_c_h_ +#define SDL_audio_c_h_ + +extern void SDL_UpdateAudio(void); + +#endif /* SDL_audio_c_h_ */ diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index ed40fd1e8..7bf48cad0 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -24,6 +24,7 @@ #include "SDL_events_c.h" #include "../SDL_hints_c.h" +#include "../audio/SDL_audio_c.h" #include "../timer/SDL_timer_c.h" #ifndef SDL_JOYSTICK_DISABLED #include "../joystick/SDL_joystick_c.h" @@ -862,7 +863,6 @@ static void SDL_PumpEventsInternal(SDL_bool push_sentinel) } #ifndef SDL_AUDIO_DISABLED - extern void SDL_UpdateAudio(void); // this is internal-only, so it doesn't have a hint and is not a public API. SDL_UpdateAudio(); #endif