sdl2-compat: sync headers and tests with latest SDL2.

From 9c475513d25d8594ad08d8539d10538036a637f8 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 30 Jun 2024 10:40:02 +0300
Subject: [PATCH] sync headers and tests with latest SDL2.

---
 include/SDL2/SDL.h                |   2 +-
 include/SDL2/SDL_assert.h         |  10 +-
 include/SDL2/SDL_atomic.h         |  34 +--
 include/SDL2/SDL_audio.h          | 123 +++++-----
 include/SDL2/SDL_bits.h           |   2 +-
 include/SDL2/SDL_blendmode.h      |  12 +-
 include/SDL2/SDL_clipboard.h      |   4 +-
 include/SDL2/SDL_endian.h         |  19 +-
 include/SDL2/SDL_error.h          |   8 +-
 include/SDL2/SDL_events.h         |  60 ++---
 include/SDL2/SDL_filesystem.h     |   4 +-
 include/SDL2/SDL_gamecontroller.h | 168 ++++++-------
 include/SDL2/SDL_gesture.h        |  12 +-
 include/SDL2/SDL_guid.h           |   8 +-
 include/SDL2/SDL_haptic.h         |  79 +++---
 include/SDL2/SDL_hidapi.h         |   6 +-
 include/SDL2/SDL_hints.h          |  52 ++--
 include/SDL2/SDL_joystick.h       | 163 ++++++------
 include/SDL2/SDL_keyboard.h       |  20 +-
 include/SDL2/SDL_loadso.h         |   8 +-
 include/SDL2/SDL_log.h            |  81 +++---
 include/SDL2/SDL_main.h           |  16 +-
 include/SDL2/SDL_messagebox.h     |  13 +-
 include/SDL2/SDL_metal.h          |   6 +-
 include/SDL2/SDL_mouse.h          |  46 ++--
 include/SDL2/SDL_mutex.h          |  38 +--
 include/SDL2/SDL_pixels.h         |  94 +++----
 include/SDL2/SDL_power.h          |   4 +-
 include/SDL2/SDL_rect.h           |  68 ++---
 include/SDL2/SDL_render.h         | 395 +++++++++++++++---------------
 include/SDL2/SDL_rwops.h          |  96 ++++----
 include/SDL2/SDL_sensor.h         |  36 +--
 include/SDL2/SDL_stdinc.h         |   5 +-
 include/SDL2/SDL_surface.h        | 200 +++++++--------
 include/SDL2/SDL_system.h         |  44 ++--
 include/SDL2/SDL_syswm.h          |   4 +-
 include/SDL2/SDL_thread.h         |  36 +--
 include/SDL2/SDL_timer.h          |  10 +-
 include/SDL2/SDL_touch.h          |   8 +-
 include/SDL2/SDL_version.h        |   2 +-
 include/SDL2/SDL_video.h          | 314 ++++++++++++------------
 include/SDL2/SDL_vulkan.h         |  20 +-
 include/SDL2/begin_code.h         |   2 +-
 test/testautomation_video.c       |  76 +++++-
 44 files changed, 1261 insertions(+), 1147 deletions(-)

diff --git a/include/SDL2/SDL.h b/include/SDL2/SDL.h
index c3eecbc..87149a5 100644
--- a/include/SDL2/SDL.h
+++ b/include/SDL2/SDL.h
@@ -131,7 +131,7 @@ extern "C" {
  * call SDL_Quit() to force shutdown). If a subsystem is already loaded then
  * this call will increase the ref-count and return.
  *
- * \param flags subsystem initialization flags
+ * \param flags subsystem initialization flags.
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *
diff --git a/include/SDL2/SDL_assert.h b/include/SDL2/SDL_assert.h
index a6a048e..894a379 100644
--- a/include/SDL2/SDL_assert.h
+++ b/include/SDL2/SDL_assert.h
@@ -193,8 +193,8 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
  * A callback that fires when an SDL assertion fails.
  *
  * \param data a pointer to the SDL_AssertData structure corresponding to the
- *             current assertion
- * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
+ *             current assertion.
+ * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
  * \returns an SDL_AssertState value indicating how to handle the failure.
  */
 typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
@@ -214,8 +214,8 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
  * This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
  *
  * \param handler the SDL_AssertionHandler function to call when an assertion
- *                fails or NULL for the default handler
- * \param userdata a pointer that is passed to `handler`
+ *                fails or NULL for the default handler.
+ * \param userdata a pointer that is passed to `handler`.
  *
  * \since This function is available since SDL 2.0.0.
  *
@@ -256,7 +256,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void
  * data, it is safe to pass a NULL pointer to this function to ignore it.
  *
  * \param puserdata pointer which is filled with the "userdata" pointer that
- *                  was passed to SDL_SetAssertionHandler()
+ *                  was passed to SDL_SetAssertionHandler().
  * \returns the SDL_AssertionHandler that is called when an assert triggers.
  *
  * \since This function is available since SDL 2.0.2.
diff --git a/include/SDL2/SDL_atomic.h b/include/SDL2/SDL_atomic.h
index d8cb3c0..5469802 100644
--- a/include/SDL2/SDL_atomic.h
+++ b/include/SDL2/SDL_atomic.h
@@ -85,7 +85,7 @@ typedef int SDL_SpinLock;
  * ***Please note that spinlocks are dangerous if you don't know what you're
  * doing. Please be careful using any sort of spinlock!***
  *
- * \param lock a pointer to a lock variable
+ * \param lock a pointer to a lock variable.
  * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
  *          held.
  *
@@ -102,7 +102,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
  * ***Please note that spinlocks are dangerous if you don't know what you're
  * doing. Please be careful using any sort of spinlock!***
  *
- * \param lock a pointer to a lock variable
+ * \param lock a pointer to a lock variable.
  *
  * \since This function is available since SDL 2.0.0.
  *
@@ -119,7 +119,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
  * ***Please note that spinlocks are dangerous if you don't know what you're
  * doing. Please be careful using any sort of spinlock!***
  *
- * \param lock a pointer to a lock variable
+ * \param lock a pointer to a lock variable.
  *
  * \since This function is available since SDL 2.0.0.
  *
@@ -262,9 +262,9 @@ typedef struct SDL_atomic_t {
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  *
- * \param a a pointer to an SDL_atomic_t variable to be modified
- * \param oldval the old value
- * \param newval the new value
+ * \param a a pointer to an SDL_atomic_t variable to be modified.
+ * \param oldval the old value.
+ * \param newval the new value.
  * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
  *
  * \since This function is available since SDL 2.0.0.
@@ -283,8 +283,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  *
- * \param a a pointer to an SDL_atomic_t variable to be modified
- * \param v the desired value
+ * \param a a pointer to an SDL_atomic_t variable to be modified.
+ * \param v the desired value.
  * \returns the previous value of the atomic variable.
  *
  * \since This function is available since SDL 2.0.2.
@@ -299,7 +299,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  *
- * \param a a pointer to an SDL_atomic_t variable
+ * \param a a pointer to an SDL_atomic_t variable.
  * \returns the current value of an atomic variable.
  *
  * \since This function is available since SDL 2.0.2.
@@ -316,8 +316,8 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  *
- * \param a a pointer to an SDL_atomic_t variable to be modified
- * \param v the desired value to add
+ * \param a a pointer to an SDL_atomic_t variable to be modified.
+ * \param v the desired value to add.
  * \returns the previous value of the atomic variable.
  *
  * \since This function is available since SDL 2.0.2.
@@ -350,9 +350,9 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  *
- * \param a a pointer to a pointer
- * \param oldval the old pointer value
- * \param newval the new pointer value
+ * \param a a pointer to a pointer.
+ * \param oldval the old pointer value.
+ * \param newval the new pointer value.
  * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
  *
  * \since This function is available since SDL 2.0.0.
@@ -369,8 +369,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  *
- * \param a a pointer to a pointer
- * \param v the desired pointer value
+ * \param a a pointer to a pointer.
+ * \param v the desired pointer value.
  * \returns the previous value of the pointer.
  *
  * \since This function is available since SDL 2.0.2.
@@ -386,7 +386,7 @@ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  *
- * \param a a pointer to a pointer
+ * \param a a pointer to a pointer.
  * \returns the current value of a pointer.
  *
  * \since This function is available since SDL 2.0.2.
diff --git a/include/SDL2/SDL_audio.h b/include/SDL2/SDL_audio.h
index 936b78a..8f874dc 100644
--- a/include/SDL2/SDL_audio.h
+++ b/include/SDL2/SDL_audio.h
@@ -152,7 +152,7 @@ typedef Uint16 SDL_AudioFormat;
  * This function is called when the audio device needs more data.
  *
  * \param userdata An application-specific parameter saved in the
- *                 SDL_AudioSpec structure
+ *                 SDL_AudioSpec structure.
  * \param stream A pointer to the audio data buffer.
  * \param len Length of **stream** in bytes.
  */
@@ -284,7 +284,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
  * meant to be proper names.
  *
  * \param index the index of the audio driver; the value ranges from 0 to
- *              SDL_GetNumAudioDrivers() - 1
+ *              SDL_GetNumAudioDrivers() - 1.
  * \returns the name of the audio driver at the requested index, or NULL if an
  *          invalid index was specified.
  *
@@ -311,7 +311,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
  * specific need to designate the audio driver you want to use. You should
  * normally use SDL_Init() or SDL_InitSubSystem().
  *
- * \param driver_name the name of the desired audio driver
+ * \param driver_name the name of the desired audio driver.
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *
@@ -449,7 +449,7 @@ typedef Uint32 SDL_AudioDeviceID;
  * ```
  *
  * \param iscapture zero to request playback devices, non-zero to request
- *                  recording devices
+ *                  recording devices.
  * \returns the number of available devices exposed by the current driver or
  *          -1 if an explicit list of devices can't be determined. A return
  *          value of -1 does not necessarily mean an error condition.
@@ -475,7 +475,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
  * invalid next time any of several other SDL functions are called.
  *
  * \param index the index of the audio device; valid values range from 0 to
- *              SDL_GetNumAudioDevices() - 1
+ *              SDL_GetNumAudioDevices() - 1.
  * \param iscapture non-zero to query the list of recording devices, zero to
  *                  query the list of output devices.
  * \returns the name of the audio device at the requested index, or NULL on
@@ -501,11 +501,11 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
  * count.
  *
  * \param index the index of the audio device; valid values range from 0 to
- *              SDL_GetNumAudioDevices() - 1
+ *              SDL_GetNumAudioDevices() - 1.
  * \param iscapture non-zero to query the list of recording devices, zero to
  *                  query the list of output devices.
  * \param spec The SDL_AudioSpec to be initialized by this function.
- * \returns 0 on success, nonzero on error
+ * \returns 0 on success, nonzero on error.
  *
  * \since This function is available since SDL 2.0.16.
  *
@@ -539,7 +539,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
  * \param spec The SDL_AudioSpec to be initialized by this function.
  * \param iscapture non-zero to query the default recording device, zero to
  *                  query the default output device.
- * \returns 0 on success, nonzero on error
+ * \returns 0 on success, nonzero on error.
  *
  * \since This function is available since SDL 2.24.0.
  *
@@ -642,12 +642,12 @@ extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name,
  *               driver-specific name as appropriate. NULL requests the most
  *               reasonable default device.
  * \param iscapture non-zero to specify a device should be opened for
- *                  recording, not playback
+ *                  recording, not playback.
  * \param desired an SDL_AudioSpec structure representing the desired output
- *                format; see SDL_OpenAudio() for more information
+ *                format; see SDL_OpenAudio() for more information.
  * \param obtained an SDL_AudioSpec structure filled in with the actual output
- *                 format; see SDL_OpenAudio() for more information
- * \param allowed_changes 0, or one or more flags OR'd together
+ *                 format; see SDL_OpenAudio() for more information.
+ * \param allowed_changes 0, or one or more flags OR'd together.
  * \returns a valid device ID that is > 0 on success or 0 on failure; call
  *          SDL_GetError() for more information.
  *
@@ -709,7 +709,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void);
  * Use this function to get the current audio state of an audio device.
  *
  * \param dev the ID of an audio device previously opened with
- *            SDL_OpenAudioDevice()
+ *            SDL_OpenAudioDevice().
  * \returns the SDL_AudioStatus of the specified audio device.
  *
  * \since This function is available since SDL 2.0.0.
@@ -742,7 +742,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioDeviceStatus(SDL_AudioDevice
  *
  * ...and is only useful if you used the legacy SDL_OpenAudio() function.
  *
- * \param pause_on non-zero to pause, 0 to unpause
+ * \param pause_on non-zero to pause, 0 to unpause.
  *
  * \since This function is available since SDL 2.0.0.
  *
@@ -772,8 +772,8 @@ extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
  * callback, you shouldn't pause the audio device, as it will lead to dropouts
  * in the audio playback. Instead, you should use SDL_LockAudioDevice().
  *
- * \param dev a device opened by SDL_OpenAudioDevice()
- * \param pause_on non-zero to pause, 0 to unpause
+ * \param dev a device opened by SDL_OpenAudioDevice().
+ * \param pause_on non-zero to pause, 0 to unpause.
  *
  * \since This function is available since SDL 2.0.0.
  *
@@ -838,14 +838,14 @@ extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
  * SDL_LoadWAV("sample.wav", &spec, &buf, &len);
  * ```
  *
- * \param src The data source for the WAVE data
- * \param freesrc If non-zero, SDL will _always_ free the data source
+ * \param src The data source for the WAVE data.
+ * \param freesrc If non-zero, SDL will _always_ free the data source.
  * \param spec An SDL_AudioSpec that will be filled in with the wave file's
- *             format details
+ *             format details.
  * \param audio_buf A pointer filled with the audio data, allocated by the
  *                  function.
  * \param audio_len A pointer filled with the length of the audio data buffer
- *                  in bytes
+ *                  in bytes.
  * \returns This function, if successfully called, returns `spec`, which will
  *          be filled with the audio data format of the wave source data.
  *          `audio_buf` will be filled with a pointer to an allocated buffer
@@ -886,7 +886,7 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
  * this function with a NULL pointer.
  *
  * \param audio_buf a pointer to the buffer created by SDL_LoadWAV() or
- *                  SDL_LoadWAV_RW()
+ *                  SDL_LoadWAV_RW().
  *
  * \since This function is available since SDL 2.0.0.
  *
@@ -910,15 +910,16 @@ extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf);
  * and then can call SDL_ConvertAudio() to complete the conversion.
  *
  * \param cvt an SDL_AudioCVT structure filled in with audio conversion
- *            information
+ *            information.
  * \param src_format the source format of the audio data; for more info see
- *                   SDL_AudioFormat
- * \param src_channels the number of channels in the source
- * \param src_rate the frequency (sample-frames-per-second) of the source
+ *                   SDL_AudioFormat.
+ * \param src_channels the number of channels in the source.
+ * \param src_rate the frequency (sample-frames-per-second) of the source.
  * \param dst_format the destination format of the audio data; for more info
- *                   see SDL_AudioFormat
- * \param dst_channels the number of channels in the destination
- * \param dst_rate the frequency (sample-frames-per-second) of the destination
+ *                   see SDL_AudioFormat.
+ * \param dst_channels the number of channels in the destination.
+ * \param dst_rate the frequency (sample-frames-per-second) of the
+ *                 destination.
  * \returns 1 if the audio filter is prepared, 0 if no conversion is needed,
  *          or a negative error code on failure; call SDL_GetError() for more
  *          information.
@@ -989,12 +990,12 @@ typedef struct _SDL_AudioStream SDL_AudioStream;
 /**
  * Create a new audio stream.
  *
- * \param src_format The format of the source audio
- * \param src_channels The number of channels of the source audio
- * \param src_rate The sampling rate of the source audio
- * \param dst_format The format of the desired audio output
- * \param dst_channels The number of channels of the desired audio output
- * \param dst_rate The sampling rate of the desired audio output
+ * \param src_format The format of the source audio.
+ * \param src_channels The number of channels of the source audio.
+ * \param src_rate The sampling rate of the source audio.
+ * \param dst_format The format of the desired audio output.
+ * \param dst_channels The number of channels of the desired audio output.
+ * \param dst_rate The sampling rate of the desired audio output.
  * \returns 0 on success, or -1 on error.
  *
  * \since This function is available since SDL 2.0.7.
@@ -1016,9 +1017,9 @@ extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioForm
 /**
  * Add data to be converted/resampled to the stream.
  *
- * \param stream The stream the audio data is being added to
- * \param buf A pointer to the audio data to add
- * \param len The number of bytes to write to the stream
+ * \param stream The stream the audio data is being added to.
+ * \param buf A pointer to the audio data to add.
+ * \param len The number of bytes to write to the stream.
  * \returns 0 on success, or -1 on error.
  *
  * \since This function is available since SDL 2.0.7.
@@ -1035,10 +1036,10 @@ extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const vo
 /**
  * Get converted/resampled data from the stream
  *
- * \param stream The stream the audio is being requested from
- * \param buf A buffer to fill with audio data
- * \param len The maximum number of bytes to fill
- * \returns the number of bytes read from the stream, or -1 on error
+ * \param stream The stream the audio is being requested from.
+ * \param buf A buffer to fill with audio data.
+ * \param len The maximum number of bytes to fill.
+ * \returns the number of bytes read from the stream, or -1 on error.
  *
  * \since This function is available since SDL 2.0.7.
  *
@@ -1133,11 +1134,11 @@ extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
  * ...where `format` is the obtained format of the audio device from the
  * legacy SDL_OpenAudio() function.
  *
- * \param dst the destination for the mixed audio
- * \param src the source audio buffer to be mixed
- * \param len the length of the audio buffer in bytes
+ * \param dst the destination for the mixed audio.
+ * \param src the source audio buffer to be mixed.
+ * \param len the length of the audio buffer in bytes.
  * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
- *               for full audio volume
+ *               for full audio volume.
  *
  * \since This function is available since SDL 2.0.0.
  *
@@ -1166,14 +1167,14 @@ extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src,
  * SDL_MixAudioFormat() is really only needed when you're mixing a single
  * audio stream with a volume adjustment.
  *
- * \param dst the destination for the mixed audio
- * \param src the source audio buffer to be mixed
+ * \param dst the destination for the mixed audio.
+ * \param src the source audio buffer to be mixed.
  * \param format the SDL_AudioFormat structure representing the desired audio
- *               format
- * \param len the length of the audio buffer in bytes
+ *               format.
+ * \param len the length of the audio buffer in bytes.
  * \param volume ranges from -128 - ∞ (at -128, the volume is at 0%, at 0 -
  *               100% and the higher the number, the bigger the %), and should
- *               be set to SDL_MIX_MAXVOLUME for full audio volume
+ *               be set to SDL_MIX_MAXVOLUME for full audio volume.
  *
  * \since This function is available since SDL 2.0.0.
  */
@@ -1217,9 +1218,9 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
  * from planar audio formats into a non-planar one (see SDL_AudioFormat)
  * before queuing audio.
  *
- * \param dev the device ID to which we will queue audio
- * \param data the data to queue to the device for later playback
- * \param len the number of bytes (not samples!) to which `data` points
+ * \param dev the device ID to which we will queue audio.
+ * \param data the data to queue to the device for later playback.
+ * \param len the number of bytes (not samples!) to which `data` points.
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *
@@ -1265,9 +1266,9 @@ extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *da
  * You should not call SDL_LockAudio() on the device before dequeueing; SDL
  * handles locking internally for this function.
  *
- * \param dev the device ID from which we will dequeue audio
- * \param data a pointer into where audio data should be copied
- * \param len the number of bytes (not samples!) to which (data) points
+ * \param dev the device ID from which we will dequeue audio.
+ * \param data a pointer into where audio data should be copied.
+ * \param len the number of bytes (not samples!) to which (data) points.
  * \returns the number of bytes dequeued, which could be less than requested;
  *          call SDL_GetError() for more information.
  *
@@ -1301,7 +1302,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *dat
  * You should not call SDL_LockAudio() on the device before querying; SDL
  * handles locking internally for this function.
  *
- * \param dev the device ID of which we will query queued audio size
+ * \param dev the device ID of which we will query queued audio size.
  * \returns the number of bytes (not samples!) of queued audio.
  *
  * \since This function is available since SDL 2.0.4.
@@ -1336,7 +1337,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
  *
  * This function always succeeds and thus returns void.
  *
- * \param dev the device ID of which to clear the audio queue
+ * \param dev the device ID of which to clear the audio queue.
  *
  * \since This function is available since SDL 2.0.4.
  *
@@ -1408,7 +1409,7 @@ extern DECLSPEC void SDLCALL SDL_LockAudio(void);
  * at once, not only will you block the audio callback, you'll block the other
  * thread.
  *
- * \param dev the ID of the device to be locked
+ * \param dev the ID of the device to be locked.
  *
  * \since This function is available since SDL 2.0.0.
  *
@@ -1441,7 +1442,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
  *
  * This function should be paired with a previous SDL_LockAudioDevice() call.
  *
- * \param dev the ID of the device to be unlocked
+ * \param dev the ID of the device to be unlocked.
  *
  * \since This function is available since SDL 2.0.0.
  *
@@ -1483,7 +1484,7 @@ extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
  * The device ID is invalid as soon as the device is closed, and is eligible
  * for reuse in a new SDL_OpenAudioDevice() call immediately.
  *
- * \param dev an audio device previously opened with SDL_OpenAudioDevice()
+ * \param dev an audio device previously opened with SDL_OpenAudioDevice().
  *
  * \since This function is available since SDL 2.0.0.
  *
diff --git a/include/SDL2/SDL_bits.h b/include/SDL2/SDL_bits.h
index 0b22131..03dda34 100644
--- a/include/SDL2/SDL_bits.h
+++ b/include/SDL2/SDL_bits.h
@@ -59,7 +59,7 @@ extern __inline int _SDL_bsr_watcom(Uint32);
 /**
  * Use this function to get the index of the most significant (set) bit in a
  *
- * \param x the number to find the MSB of
+ * \param x the number to find the MSB of.
  * \returns the index of the most significant bit of x, or -1 if x is 0.
  */
 SDL_FORCE_INLINE int
diff --git a/include/SDL2/SDL_blendmode.h b/include/SDL2/SDL_blendmode.h
index 75d21fe..7a13585 100644
--- a/include/SDL2/SDL_blendmode.h
+++ b/include/SDL2/SDL_blendmode.h
@@ -159,18 +159,18 @@ typedef enum SDL_BlendFactor
  * case.
  *
  * \param srcColorFactor the SDL_BlendFactor applied to the red, green, and
- *                       blue components of the source pixels
+ *                       blue components of the source pixels.
  * \param dstColorFactor the SDL_BlendFactor applied to the red, green, and
- *                       blue components of the destination pixels
+ *                       blue components of the destination pixels.
  * \param colorOperation the SDL_BlendOperation used to combine the red,
  *                       green, and blue components of the source and
- *                       destination pixels
+ *                       destination pixels.
  * \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of
- *                       the source pixels
+ *                       the source pixels.
  * \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of
- *                       the destination pixels
+ *                       the destination pixels.
  * \param alphaOperation the SDL_BlendOperation used to combine the alpha
- *                       component of the source and destination pixels
+ *                       component of the source and destination pixels.
  * \returns an SDL_BlendMode that represents the chosen factors and
  *          operations.
  *
diff --git a/include/SDL2/SDL_clipboard.h b/include/SDL2/SDL_clipboard.h
index 3a02774..e5623e9 100644
--- a/include/SDL2/SDL_clipboard.h
+++ b/include/SDL2/SDL_clipboard.h
@@ -41,7 +41,7 @@ extern "C" {
 /**
  * Put UTF-8 text into the clipboard.
  *
- * \param text the text to store in the clipboard
+ * \param text the text to store in the clipboard.
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *
@@ -85,7 +85,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
 /**
  * Put UTF-8 text into the primary selection.
  *
- * \param text the text to store in the primary selection
+ * \param text the text to store in the primary selection.
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *
diff --git a/include/SDL2/SDL_endian.h b/include/SDL2/SDL_endian.h
index 38ae231..594ae0b 100644
--- a/include/SDL2/SDL_endian.h
+++ b/include/SDL2/SDL_endian.h
@@ -59,6 +59,15 @@ _m_prefetch(void *__P)
 #ifdef __linux__
 #include <endian.h>
 #define SDL_BYTEORDER  __BYTE_ORDER
+#elif defined(__sun) && defined(__SVR4)  /* Solaris */
+#include <sys/byteorder.h>
+#if defined(_LITTLE_ENDIAN)
+#define SDL_BYTEORDER   SDL_LIL_ENDIAN
+#elif defined(_BIG_ENDIAN)
+#define SDL_BYTEORDER   SDL_BIG_ENDIAN
+#else
+#error Unsupported endianness
+#endif
 #elif defined(__OpenBSD__) || defined(__DragonFly__)
 #include <endian.h>
 #define SDL_BYTEORDER  BYTE_ORDER
@@ -79,7 +88,7 @@ _m_prefetch(void *__P)
     defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
     (defined(__MIPS__) && defined(__MIPSEB__)) || \
     defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
-    defined(__sparc__)
+    defined(__sparc__) || defined(__sparc)
 #define SDL_BYTEORDER   SDL_BIG_ENDIAN
 #else
 #define SDL_BYTEORDER   SDL_LIL_ENDIAN
@@ -184,7 +193,7 @@ extern __inline Uint16 SDL_Swap16(Uint16);
 /**
  * Use this function to swap the byte order of a 16-bit value.
  *
- * \param x the value to be swapped
+ * \param x the value to be swapped.
  * \returns the swapped value.
  *
  * \sa SDL_SwapBE16
@@ -245,7 +254,7 @@ extern __inline Uint32 SDL_Swap32(Uint32);
 /**
  * Use this function to swap the byte order of a 32-bit value.
  *
- * \param x the value to be swapped
+ * \param x the value to be swapped.
  * \returns the swapped value.
  *
  * \sa SDL_SwapBE32
@@ -300,7 +309,7 @@ extern __inline Uint64 SDL_Swap64(Uint64);
 /**
  * Use this function to swap the byte order of a 64-bit value.
  *
- * \param x the value to be swapped
+ * \param x the value to be swapped.
  * \returns the swapped value.
  *
  * \sa SDL_SwapBE64
@@ -326,7 +335,7 @@ SDL_Swap64(Uint64 x)
 /**
  * Use this function to swap the byte order of a floating point value.
  *
- * \param x the value to be swapped
+ * \param x the value to be swapped.
  * \returns the swapped value.
  *
  * \sa SDL_SwapFloatBE
diff --git a/include/SDL2/SDL_error.h b/include/SDL2/SDL_error.h
index aca98f7..69e0bb6 100644
--- a/include/SDL2/SDL_error.h
+++ b/include/SDL2/SDL_error.h
@@ -53,9 +53,9 @@ extern "C" {
  * }
  * ```
  *
- * \param fmt a printf()-style message format string
+ * \param fmt a printf()-style message format string.
  * \param ... additional parameters matching % tokens in the `fmt` string, if
- *            any
+ *            any.
  * \returns always -1.
  *
  * \since This function is available since SDL 2.0.0.
@@ -109,8 +109,8 @@ extern DECLSPEC const char *SDLCALL SDL_GetError(void);
  * otherwise operates exactly the same as SDL_GetError().
  *
  * \param errstr A buffer to fill with the last error message that was set for
- *               the current thread
- * \param maxlen The size of the buffer pointed to by the errstr parameter
+ *               the current thread.
+ * \param maxlen The size of the buffer pointed to by the errstr parameter.
  * \returns the pointer passed in as the `errstr` parameter.
  *
  * \since This function is available since SDL 2.0.14.
diff --git a/include/SDL2/SDL_events.h b/include/SDL2/SDL_events.h
index ada011a..81fd6e4 100644
--- a/include/SDL2/SDL_events.h
+++ b/include/SDL2/SDL_events.h
@@ -746,15 +746,15 @@ typedef enum SDL_eventaction
  *
  * This function is thread-safe.
  *
- * \param events destination buffer for the retrieved events
+ * \pa

(Patch may be truncated, please check the link at the top of this post.)