SDL: Renamed DECLSPEC to SDL_DECLSPEC

From 6f2621438a65abae114a7210914352b4c1d9c6c3 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 17 May 2024 16:52:36 -0700
Subject: [PATCH] Renamed DECLSPEC to SDL_DECLSPEC

---
 build-scripts/check_stdlib_usage.py    |   2 +-
 build-scripts/wikiheaders.pl           |  14 +-
 docs/README-documentation-rules.md     |   2 +-
 docs/doxyfile                          |   2 +-
 include/SDL3/SDL_assert.h              |  12 +-
 include/SDL3/SDL_atomic.h              |  24 +--
 include/SDL3/SDL_audio.h               |  82 +++----
 include/SDL3/SDL_begin_code.h          |  10 +-
 include/SDL3/SDL_blendmode.h           |   2 +-
 include/SDL3/SDL_camera.h              |  30 +--
 include/SDL3/SDL_clipboard.h           |  20 +-
 include/SDL3/SDL_cpuinfo.h             |  36 ++--
 include/SDL3/SDL_dialog.h              |   6 +-
 include/SDL3/SDL_error.h               |   8 +-
 include/SDL3/SDL_events.h              |  38 ++--
 include/SDL3/SDL_filesystem.h          |  18 +-
 include/SDL3/SDL_gamepad.h             | 146 ++++++-------
 include/SDL3/SDL_guid.h                |   4 +-
 include/SDL3/SDL_haptic.h              |  62 +++---
 include/SDL3/SDL_hidapi.h              |  44 ++--
 include/SDL3/SDL_hints.h               |  16 +-
 include/SDL3/SDL_init.h                |  10 +-
 include/SDL3/SDL_iostream.h            |  86 ++++----
 include/SDL3/SDL_joystick.h            | 120 +++++------
 include/SDL3/SDL_keyboard.h            |  42 ++--
 include/SDL3/SDL_loadso.h              |   6 +-
 include/SDL3/SDL_locale.h              |   2 +-
 include/SDL3/SDL_log.h                 |  30 +--
 include/SDL3/SDL_main.h                |  14 +-
 include/SDL3/SDL_messagebox.h          |   4 +-
 include/SDL3/SDL_metal.h               |   6 +-
 include/SDL3/SDL_misc.h                |   2 +-
 include/SDL3/SDL_mouse.h               |  44 ++--
 include/SDL3/SDL_mutex.h               |  50 ++---
 include/SDL3/SDL_pen.h                 |  16 +-
 include/SDL3/SDL_pixels.h              |  26 +--
 include/SDL3/SDL_platform.h            |   2 +-
 include/SDL3/SDL_power.h               |   2 +-
 include/SDL3/SDL_properties.h          |  42 ++--
 include/SDL3/SDL_rect.h                |  20 +-
 include/SDL3/SDL_render.h              | 166 +++++++-------
 include/SDL3/SDL_sensor.h              |  28 +--
 include/SDL3/SDL_stdinc.h              | 288 ++++++++++++-------------
 include/SDL3/SDL_storage.h             |  32 +--
 include/SDL3/SDL_surface.h             |  84 ++++----
 include/SDL3/SDL_system.h              |  66 +++---
 include/SDL3/SDL_thread.h              |  28 +--
 include/SDL3/SDL_time.h                |  18 +-
 include/SDL3/SDL_timer.h               |  16 +-
 include/SDL3/SDL_touch.h               |   8 +-
 include/SDL3/SDL_version.h             |   4 +-
 include/SDL3/SDL_video.h               | 206 +++++++++---------
 include/SDL3/SDL_vulkan.h              |  12 +-
 src/SDL_internal.h                     |  16 +-
 src/core/SDL_core_unsupported.c        |  49 ++---
 src/core/SDL_runapp.c                  |   3 +-
 src/core/gdk/SDL_gdk.cpp               |  23 +-
 src/core/n3ds/SDL_n3ds.c               |   3 +-
 src/core/ngage/SDL_ngage_runapp.cpp    |   3 +-
 src/core/ps2/SDL_ps2.c                 |   3 +-
 src/core/psp/SDL_psp.c                 |   3 +-
 src/core/windows/SDL_windows.c         |   2 +-
 src/core/winrt/SDL_winrtapp_common.cpp |   8 +-
 src/dynapi/SDL_dynapi.c                |   2 +-
 src/dynapi/gendynapi.py                |   4 +-
 src/thread/SDL_thread.c                |   4 +-
 src/video/SDL_video_unsupported.c      |  14 +-
 67 files changed, 1093 insertions(+), 1102 deletions(-)

diff --git a/build-scripts/check_stdlib_usage.py b/build-scripts/check_stdlib_usage.py
index 8dea74e14b1f7..93e1333afd02f 100755
--- a/build-scripts/check_stdlib_usage.py
+++ b/build-scripts/check_stdlib_usage.py
@@ -208,7 +208,7 @@ def find_symbols_in_file(file, regex):
 
                     # double check
                     # Remove one line comment /* ... */
-                    # eg: extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
+                    # eg: extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
                     l = reg_comment_remove_content.sub('', l)
 
                     # Remove strings " ... "
diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index 2669e33a0fa98..f5b3cde695f28 100755
--- a/build-scripts/wikiheaders.pl
+++ b/build-scripts/wikiheaders.pl
@@ -746,7 +746,7 @@ sub print_undocumented_section {
             #print("CATEGORY FOR '$dent' CHANGED TO " . (defined($current_wiki_category) ? "'$current_wiki_category'" : '(undef)') . "\n");
             push @contents, $_;
             next;
-        } elsif (/\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_)?DECLSPEC/) {  # a function declaration without a doxygen comment?
+        } elsif (/\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC/) {  # a function declaration without a doxygen comment?
             $symtype = 1;   # function declaration
             @templines = ();
             $decl = $_;
@@ -819,7 +819,7 @@ sub print_undocumented_section {
                 $lineno++ if defined $decl;
                 $decl = '' if not defined $decl;
                 chomp($decl);
-                if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_)?DECLSPEC/) {
+                if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC/) {
                     $symtype = 1;   # function declaration
                 } elsif ($decl =~ /\A\s*SDL_FORCE_INLINE/) {
                     $symtype = 1;   # (forced-inline) function declaration
@@ -888,9 +888,8 @@ sub print_undocumented_section {
 
             $decl =~ s/\s+\Z//;
 
-            if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_)?DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)\s*(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
+            if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)\s*(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
                 $sym = $7;
-                #$decl =~ s/\A\s*extern\s+DECLSPEC\s+(.*?)\s+SDLCALL/$1/;
             } elsif ($is_forced_inline && $decl =~ /\A\s*SDL_FORCE_INLINE\s+(SDL_DEPRECATED\s+|)(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(.*?)\s*\((.*?)\);/) {
                 $sym = $6;
             } else {
@@ -909,11 +908,11 @@ sub print_undocumented_section {
                 foreach (@decllines) {
                     if ($decl eq '') {
                         $decl = $_;
-                        $decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_)?DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$3$4 /;
+                        $decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$3$4 /;
                     } else {
                         my $trimmed = $_;
                         # !!! FIXME: trim space for SDL_DEPRECATED if it was used, too.
-                        $trimmed =~ s/\A\s{24}//;  # 24 for shrinking to match the removed "extern DECLSPEC SDLCALL "
+                        $trimmed =~ s/\A\s{28}//;  # 28 for shrinking to match the removed "extern SDL_DECLSPEC SDLCALL "
                         $decl .= $trimmed;
                     }
                     $decl .= "\n";
@@ -974,7 +973,6 @@ sub print_undocumented_section {
         } elsif ($symtype == 2) {  # a macro
             if ($decl =~ /\A\s*\#\s*define\s+(.*?)(\(.*?\)|)\s+/) {
                 $sym = $1;
-                #$decl =~ s/\A\s*extern\s+DECLSPEC\s+(.*?)\s+SDLCALL/$1/;
             } else {
                 #print "Found doxygen but no macro:\n$str\n\n";
                 foreach (@templines) {
@@ -1697,8 +1695,6 @@ sub print_undocumented_section {
         $remarks =~ s/\s*\Z//;
 
         my $decl = $headerdecls{$sym};
-        #$decl =~ s/\*\s+SDLCALL/ *SDLCALL/;  # Try to make "void * Function" become "void *Function"
-        #$decl =~ s/\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL/$2$3/;
 
         my $syntax = '';
         if ($wikitype eq 'mediawiki') {
diff --git a/docs/README-documentation-rules.md b/docs/README-documentation-rules.md
index 262a6006c6ddd..6f38094e2287c 100644
--- a/docs/README-documentation-rules.md
+++ b/docs/README-documentation-rules.md
@@ -57,7 +57,7 @@ standard comment format:
  *
  * \sa SDL_DoSomethingElse
  */
-extern DECLSPEC int SDLCALL SDL_DoSomething(int frozzlevel, int color);
+extern SDL_DECLSPEC int SDLCALL SDL_DoSomething(int frozzlevel, int color);

Note the /** at the start of the comment. That’s a “Doxygen-style” comment,
diff --git a/docs/doxyfile b/docs/doxyfile
index 8af297423160f…19de1623b756c 100644
— a/docs/doxyfile
+++ b/docs/doxyfile
@@ -1297,7 +1297,7 @@ INCLUDE_FILE_PATTERNS =

instead of the = operator.

PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 \

  •                     DECLSPEC= \
    
  •                     SDL_DECLSPEC= \
                        SDLCALL= \
                        _WIN32=1
    

diff --git a/include/SDL3/SDL_assert.h b/include/SDL3/SDL_assert.h
index 9de1990221424…1b74e0430e960 100644
— a/include/SDL3/SDL_assert.h
+++ b/include/SDL3/SDL_assert.h
@@ -240,7 +240,7 @@ typedef struct SDL_AssertData
*

  • \since This function is available since SDL 3.0.0.
    */
    -extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,
    +extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,
    const char *func,
    const char *file, int line)
    #ifdef clang
    @@ -464,7 +464,7 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
  • \sa SDL_GetAssertionHandler
    */
    -extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
    +extern SDL_DECLSPEC void SDLCALL SDL_SetAssertionHandler(
    SDL_AssertionHandler handler,
    void *userdata);

@@ -483,7 +483,7 @@ extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
*

  • \sa SDL_GetAssertionHandler
    */
    -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
    +extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);

/**

  • Get the current assertion handler.
    @@ -506,7 +506,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void
  • \sa SDL_SetAssertionHandler
    */
    -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
    +extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);

/**

  • Get a list of all assertion failures.
    @@ -534,7 +534,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puse
  • \sa SDL_ResetAssertionReport
    */
    -extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
    +extern SDL_DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);

/**

  • Clear the list of all assertion failures.
    @@ -548,7 +548,7 @@ extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
  • \sa SDL_GetAssertionReport
    */
    -extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
    +extern SDL_DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
diff --git a/include/SDL3/SDL_atomic.h b/include/SDL3/SDL_atomic.h
index 9d2c27b8e3a9e…575391ef0ec52 100644
— a/include/SDL3/SDL_atomic.h
+++ b/include/SDL3/SDL_atomic.h
@@ -96,7 +96,7 @@ typedef int SDL_SpinLock;

  • \sa SDL_LockSpinlock
  • \sa SDL_UnlockSpinlock
    */
    -extern DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
    +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);

/**

  • Lock a spin lock by setting it to a non-zero value.
    @@ -111,7 +111,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
  • \sa SDL_TryLockSpinlock
  • \sa SDL_UnlockSpinlock
    */
    -extern DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock);
    +extern SDL_DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock);

/**

  • Unlock a spin lock by setting it to 0.
    @@ -128,7 +128,7 @@ extern DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock);
  • \sa SDL_LockSpinlock
  • \sa SDL_TryLockSpinlock
    */
    -extern DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);
    +extern SDL_DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);

#ifdef SDL_WIKI_DOCUMENTATION_SECTION
@@ -192,7 +192,7 @@ extern __inline void SDL_CompilerBarrier(void);
*

  • \since This function is available since SDL 3.0.0.
    */
    -extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
    +extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);

/**

  • Insert a memory acquire barrier.
    @@ -207,7 +207,7 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
  • \sa SDL_MemoryBarrierReleaseFunction
    */
    -extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
    +extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);

/* !!! FIXME: this should have documentation! */
#if defined(GNUC) && (defined(powerpc) || defined(ppc))
@@ -342,7 +342,7 @@ typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
*

  • \sa SDL_AtomicCompareAndSwapPointer
    */
    -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwap(SDL_AtomicInt *a, int oldval, int newval);
    +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwap(SDL_AtomicInt *a, int oldval, int newval);

/**

  • Set an atomic variable to a value.
    @@ -360,7 +360,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwap(SDL_AtomicInt *a, int
  • \sa SDL_AtomicGet
    */
    -extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_AtomicInt *a, int v);
    +extern SDL_DECLSPEC int SDLCALL SDL_AtomicSet(SDL_AtomicInt *a, int v);

/**

  • Get the value of an atomic variable.
    @@ -375,7 +375,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_AtomicInt *a, int v);
  • \sa SDL_AtomicSet
    */
    -extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_AtomicInt *a);
    +extern SDL_DECLSPEC int SDLCALL SDL_AtomicGet(SDL_AtomicInt *a);

/**

  • Add to an atomic variable.
    @@ -394,7 +394,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_AtomicInt *a);
  • \sa SDL_AtomicDecRef
  • \sa SDL_AtomicIncRef
    */
    -extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v);
    +extern SDL_DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v);

#ifndef SDL_AtomicIncRef

@@ -448,7 +448,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v);

  • \sa SDL_AtomicGetPtr
  • \sa SDL_AtomicSetPtr
    */
    -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval);
    +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval);

/**

  • Set a pointer to a value atomically.
    @@ -465,7 +465,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void
  • \sa SDL_AtomicCompareAndSwapPointer
  • \sa SDL_AtomicGetPtr
    /
    -extern DECLSPEC void
    SDLCALL SDL_AtomicSetPtr(void a, void v);
    +extern SDL_DECLSPEC void
    SDLCALL SDL_AtomicSetPtr(void *a, void v);

/**

  • Get the value of a pointer atomically.
    @@ -481,7 +481,7 @@ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void *a, void v);
  • \sa SDL_AtomicCompareAndSwapPointer
  • \sa SDL_AtomicSetPtr
    /
    -extern DECLSPEC void
    SDLCALL SDL_AtomicGetPtr(void *a);
    +extern SDL_DECLSPEC void
    SDLCALL SDL_AtomicGetPtr(void **a);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h
index 5c147948eeb47…79a9ea67c4cee 100644
— a/include/SDL3/SDL_audio.h
+++ b/include/SDL3/SDL_audio.h
@@ -364,7 +364,7 @@ typedef struct SDL_AudioStream SDL_AudioStream;
*

  • \sa SDL_GetAudioDriver
    */
    -extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
    +extern SDL_DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);

/**

  • Use this function to get the name of a built in audio driver.
    @@ -388,7 +388,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
  • \sa SDL_GetNumAudioDrivers
    */
    -extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
    +extern SDL_DECLSPEC const char SDLCALL SDL_GetAudioDriver(int index);
    /
    @} */

/**
@@ -407,7 +407,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
*

  • \since This function is available since SDL 3.0.0.
    */
    -extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
    +extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);

/**

  • Get a list of currently-connected audio output devices.
    @@ -432,7 +432,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
  • \sa SDL_OpenAudioDevice
  • \sa SDL_GetAudioCaptureDevices
    */
    -extern DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioOutputDevices(int *count);
    +extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioOutputDevices(int *count);

/**

  • Get a list of currently-connected audio capture devices.
    @@ -457,7 +457,7 @@ extern DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioOutputDevices(int *count)
  • \sa SDL_OpenAudioDevice
  • \sa SDL_GetAudioOutputDevices
    */
    -extern DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioCaptureDevices(int *count);
    +extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioCaptureDevices(int *count);

/**

  • Get the human-readable name of a specific audio device.
    @@ -476,7 +476,7 @@ extern DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioCaptureDevices(int *count
  • \sa SDL_GetAudioCaptureDevices
  • \sa SDL_GetDefaultAudioInfo
    */
    -extern DECLSPEC char *SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
    +extern SDL_DECLSPEC char *SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);

/**

  • Get the current audio format of a specific audio device.
    @@ -511,7 +511,7 @@ extern DECLSPEC char *SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
  • \since This function is available since SDL 3.0.0.
    */
    -extern DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
    +extern SDL_DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);

/**
@@ -587,7 +587,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SD

  • \sa SDL_CloseAudioDevice
  • \sa SDL_GetAudioDeviceFormat
    */
    -extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec);
    +extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec);

/**

  • Use this function to pause audio playback on a specified device.
    @@ -618,7 +618,7 @@ extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDeviceID
  • \sa SDL_ResumeAudioDevice
  • \sa SDL_AudioDevicePaused
    */
    -extern DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
    +extern SDL_DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);

/**

  • Use this function to unpause audio playback on a specified device.
    @@ -646,7 +646,7 @@ extern DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
  • \sa SDL_AudioDevicePaused
  • \sa SDL_PauseAudioDevice
    */
    -extern DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
    +extern SDL_DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);

/**

  • Use this function to query if an audio device is paused.
    @@ -668,7 +668,7 @@ extern DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
  • \sa SDL_PauseAudioDevice
  • \sa SDL_ResumeAudioDevice
    */
    -extern DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
    +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);

/**

  • Close a previously-opened audio device.
    @@ -689,7 +689,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
  • \sa SDL_OpenAudioDevice
    */
    -extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
    +extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);

/**

  • Bind a list of audio streams to an audio device.
    @@ -726,7 +726,7 @@ extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
  • \sa SDL_UnbindAudioStream
  • \sa SDL_GetAudioStreamDevice
    */
    -extern DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);
    +extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);

/**

  • Bind a single audio stream to an audio device.
    @@ -747,7 +747,7 @@ extern DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_Au
  • \sa SDL_UnbindAudioStream
  • \sa SDL_GetAudioStreamDevice
    */
    -extern DECLSPEC int SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
    +extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);

/**

  • Unbind a list of audio streams from their audio devices.
    @@ -767,7 +767,7 @@ extern DECLSPEC int SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_Aud
  • \sa SDL_BindAudioStreams
    */
    -extern DECLSPEC void SDLCALL SDL_UnbindAudioStreams(SDL_AudioStream **streams, int num_streams);
    +extern SDL_DECLSPEC void SDLCALL SDL_UnbindAudioStreams(SDL_AudioStream **streams, int num_streams);

/**

  • Unbind a single audio stream from its audio device.
    @@ -783,7 +783,7 @@ extern DECLSPEC void SDLCALL SDL_UnbindAudioStreams(SDL_AudioStream **streams, i
  • \sa SDL_BindAudioStream
    */
    -extern DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);

/**

  • Query an audio stream for its currently-bound device.
    @@ -803,7 +803,7 @@ extern DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
  • \sa SDL_BindAudioStream
  • \sa SDL_BindAudioStreams
    */
    -extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_AudioStream *stream);

/**

  • Create a new audio stream.
    @@ -824,7 +824,7 @@ extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_AudioStre
  • \sa SDL_ChangeAudioStreamOutput
  • \sa SDL_DestroyAudioStream
    */
    -extern DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);
    +extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);

/**

  • Get the properties associated with an audio stream.
    @@ -838,7 +838,7 @@ extern DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_AudioSp
  • \sa SDL_GetProperty
  • \sa SDL_SetProperty
    */
    -extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);

/**

  • Query the current format of an audio stream.
    @@ -853,7 +853,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioS
  • \since This function is available since SDL 3.0.0.
    */
    -extern DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream,
    +extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream,
    SDL_AudioSpec *src_spec,
    SDL_AudioSpec *dst_spec);

@@ -885,7 +885,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream,

  • \sa SDL_GetAudioStreamFormat
  • \sa SDL_SetAudioStreamFrequencyRatio
    */
    -extern DECLSPEC int SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream,
    +extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream,
    const SDL_AudioSpec *src_spec,
    const SDL_AudioSpec *dst_spec);

@@ -902,7 +902,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream,
*

  • \sa SDL_SetAudioStreamFrequencyRatio
    */
    -extern DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream);

/**

  • Change the frequency ratio of an audio stream.
    @@ -929,7 +929,7 @@ extern DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *
  • \sa SDL_GetAudioStreamFrequencyRatio
  • \sa SDL_SetAudioStreamFormat
    */
    -extern DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
    +extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);

/**

  • Add data to the stream.
    @@ -959,7 +959,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *st
  • \sa SDL_GetAudioStreamData
  • \sa SDL_GetAudioStreamQueued
    */
    -extern DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
    +extern SDL_DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);

/**

  • Get converted/resampled data from the stream.
    @@ -988,7 +988,7 @@ extern DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, cons
  • \sa SDL_GetAudioStreamAvailable
  • \sa SDL_PutAudioStreamData
    */
    -extern DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream, void *buf, int len);
    +extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream, void *buf, int len);

/**

  • Get the number of converted/resampled bytes available.
    @@ -1013,7 +1013,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream, void
  • \sa SDL_GetAudioStreamData
  • \sa SDL_PutAudioStreamData
    */
    -extern DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *stream);

/**
@@ -1045,7 +1045,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *stream)

  • \sa SDL_PutAudioStreamData
  • \sa SDL_ClearAudioStream
    */
    -extern DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream);

/**
@@ -1066,7 +1066,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream);
*

  • \sa SDL_PutAudioStreamData
    */
    -extern DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);

/**

  • Clear any pending data in the stream.
    @@ -1087,7 +1087,7 @@ extern DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
  • \sa SDL_GetAudioStreamQueued
  • \sa SDL_PutAudioStreamData
    */
    -extern DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);

/**

  • Lock an audio stream for serialized access.
    @@ -1115,7 +1115,7 @@ extern DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
  • \sa SDL_UnlockAudioStream
    */
    -extern DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);

/**
@@ -1134,7 +1134,7 @@ extern DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
*

  • \sa SDL_LockAudioStream
    */
    -extern DECLSPEC int SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC int SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);

/**

  • A callback that fires when data passes through an SDL_AudioStream.
    @@ -1221,7 +1221,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
  • \sa SDL_SetAudioStreamPutCallback
    */
    -extern DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
    +extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);

/**

  • Set a callback that runs when data is added to an audio stream.
    @@ -1269,7 +1269,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *strea
  • \sa SDL_SetAudioStreamGetCallback
    */
    -extern DECLSPEC int SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
    +extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);

/**
@@ -1291,7 +1291,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *strea
*

  • \sa SDL_CreateAudioStream
    */
    -extern DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream);
    +extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream);

/**
@@ -1348,7 +1348,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream);

  • \sa SDL_GetAudioStreamDevice
  • \sa SDL_ResumeAudioDevice
    */
    -extern DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec, SDL_AudioStreamCallback callback, void *userdata);
    +extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec, SDL_AudioStreamCallback callback, void *userdata);

/**

  • A callback that fires when data is about to be fed to an audio device.
    @@ -1435,7 +1435,7 @@ typedef void (SDLCALL *SDL_AudioPostmixCallback)(void *userdata, const SDL_Audio
  • \since This function is available since SDL 3.0.0.
    */
    -extern DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);
    +extern SDL_DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);

/**
@@ -1516,7 +1516,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid,

  • \sa SDL_free
  • \sa SDL_LoadWAV
    */
    -extern DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool closeio,
    +extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool closeio,
    SDL_AudioSpec * spec, Uint8 ** audio_buf,
    Uint32 * audio_len);

@@ -1554,7 +1554,7 @@ extern DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool closeio,

  • \sa SDL_free
  • \sa SDL_LoadWAV_IO
    */
    -extern DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * spec,
    +extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * spec,
    Uint8 ** audio_buf, Uint32 * audio_len);

/**
@@ -1591,7 +1591,7 @@ extern DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * spec,
*

  • \since This function is available since SDL 3.0.0.
    */
    -extern DECLSPEC int SDLCALL SDL_MixAudio(Uint8 * dst,
    +exte
(Patch may be truncated, please check the link at the top of this post.)