Skip to content

Commit fd71d46

Browse files
committed
Fixed Apple Xcode build
1 parent 5c44987 commit fd71d46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3327
-710
lines changed

Xcode/SDL_mixer.xcodeproj/project.pbxproj

Lines changed: 92 additions & 227 deletions
Large diffs are not rendered by default.

Xcode/iOS/SDL3.framework/Headers/SDL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121

2222
/**
23-
* Main include header for the SDL library, version 3.2.6
23+
* Main include header for the SDL library, version 3.3.0
2424
*
2525
* It is almost always best to include just this one header instead of
2626
* picking out individual headers included here. There are exceptions to

Xcode/iOS/SDL3.framework/Headers/SDL_assert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ extern "C" {
132132
#define SDL_TriggerBreakpoint() __debugbreak()
133133
#elif defined(_MSC_VER) && defined(_M_IX86)
134134
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
135-
#elif defined(ANDROID)
135+
#elif defined(ANDROID) || defined(__SYMBIAN32__)
136136
#include <assert.h>
137137
#define SDL_TriggerBreakpoint() assert(0)
138138
#elif SDL_HAS_BUILTIN(__builtin_debugtrap)

Xcode/iOS/SDL3.framework/Headers/SDL_audio.h

Lines changed: 166 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
942942
* Binding a stream to a device will set its output format for playback
943943
* devices, and its input format for recording devices, so they match the
944944
* device's settings. The caller is welcome to change the other end of the
945-
* stream's format at any time with SDL_SetAudioStreamFormat().
945+
* stream's format at any time with SDL_SetAudioStreamFormat(). If the other
946+
* end of the stream's format has never been set (the audio stream was created
947+
* with a NULL audio spec), this function will set it to match the device
948+
* end's format.
946949
*
947950
* \param devid an audio device to bind a stream to.
948951
* \param streams an array of audio streams to bind.
@@ -1021,7 +1024,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
10211024
/**
10221025
* Query an audio stream for its currently-bound device.
10231026
*
1024-
* This reports the audio device that an audio stream is currently bound to.
1027+
* This reports the logical audio device that an audio stream is currently
1028+
* bound to.
10251029
*
10261030
* If not bound, or invalid, this returns zero, which is not a valid device
10271031
* ID.
@@ -1063,6 +1067,17 @@ extern SDL_DECLSPEC SDL_AudioStream * SDLCALL SDL_CreateAudioStream(const SDL_Au
10631067
/**
10641068
* Get the properties associated with an audio stream.
10651069
*
1070+
* The application can hang any data it wants here, but the following
1071+
* properties are understood by SDL:
1072+
*
1073+
* - `SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN`: if true (the default), the
1074+
* stream be automatically cleaned up when the audio subsystem quits. If set
1075+
* to false, the streams will persist beyond that. This property is ignored
1076+
* for streams created through SDL_OpenAudioDeviceStream(), and will always
1077+
* be cleaned up. Streams that are not cleaned up will still be unbound from
1078+
* devices when the audio subsystem quits. This property was added in SDL
1079+
* 3.4.0.
1080+
*
10661081
* \param stream the SDL_AudioStream to query.
10671082
* \returns a valid property ID on success or 0 on failure; call
10681083
* SDL_GetError() for more information.
@@ -1073,6 +1088,9 @@ extern SDL_DECLSPEC SDL_AudioStream * SDLCALL SDL_CreateAudioStream(const SDL_Au
10731088
*/
10741089
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);
10751090

1091+
#define SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN "SDL.audiostream.auto_cleanup"
1092+
1093+
10761094
/**
10771095
* Query the current format of an audio stream.
10781096
*
@@ -1149,14 +1167,14 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre
11491167
*
11501168
* The frequency ratio is used to adjust the rate at which input data is
11511169
* consumed. Changing this effectively modifies the speed and pitch of the
1152-
* audio. A value greater than 1.0 will play the audio faster, and at a higher
1153-
* pitch. A value less than 1.0 will play the audio slower, and at a lower
1154-
* pitch.
1170+
* audio. A value greater than 1.0f will play the audio faster, and at a
1171+
* higher pitch. A value less than 1.0f will play the audio slower, and at a
1172+
* lower pitch. 1.0f means play at normal speed.
11551173
*
11561174
* This is applied during SDL_GetAudioStreamData, and can be continuously
11571175
* changed to create various effects.
11581176
*
1159-
* \param stream the stream the frequency ratio is being changed.
1177+
* \param stream the stream on which the frequency ratio is being changed.
11601178
* \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01
11611179
* and 100.
11621180
* \returns true on success or false on failure; call SDL_GetError() for more
@@ -1332,7 +1350,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStre
13321350
* Channel maps are optional; most things do not need them, instead passing
13331351
* data in the [order that SDL expects](CategoryAudio#channel-layouts).
13341352
*
1335-
* The output channel map reorders data that leaving a stream via
1353+
* The output channel map reorders data that is leaving a stream via
13361354
* SDL_GetAudioStreamData.
13371355
*
13381356
* Each item in the array represents an input channel, and its value is the
@@ -1414,6 +1432,136 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStr
14141432
*/
14151433
extern SDL_DECLSPEC bool SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
14161434

1435+
/**
1436+
* A callback that fires for completed SDL_PutAudioStreamDataNoCopy() data.
1437+
*
1438+
* When using SDL_PutAudioStreamDataNoCopy() to provide data to an
1439+
* SDL_AudioStream, it's not safe to dispose of the data until the stream has
1440+
* completely consumed it. Often times it's difficult to know exactly when
1441+
* this has happened.
1442+
*
1443+
* This callback fires once when the stream no longer needs the buffer,
1444+
* allowing the app to easily free or reuse it.
1445+
*
1446+
* \param userdata an opaque pointer provided by the app for their personal
1447+
* use.
1448+
* \param buf the pointer provided to SDL_PutAudioStreamDataNoCopy().
1449+
* \param buflen the size of buffer, in bytes, provided to
1450+
* SDL_PutAudioStreamDataNoCopy().
1451+
*
1452+
* \threadsafety This callbacks may run from any thread, so if you need to
1453+
* protect shared data, you should use SDL_LockAudioStream to
1454+
* serialize access; this lock will be held before your callback
1455+
* is called, so your callback does not need to manage the lock
1456+
* explicitly.
1457+
*
1458+
* \since This datatype is available since SDL 3.4.0.
1459+
*
1460+
* \sa SDL_SetAudioStreamGetCallback
1461+
* \sa SDL_SetAudioStreamPutCallback
1462+
*/
1463+
typedef void (SDLCALL *SDL_AudioStreamDataCompleteCallback)(void *userdata, const void *buf, int buflen);
1464+
1465+
/**
1466+
* Add external data to an audio stream without copying it.
1467+
*
1468+
* Unlike SDL_PutAudioStreamData(), this function does not make a copy of the
1469+
* provided data, instead storing the provided pointer. This means that the
1470+
* put operation does not need to allocate and copy the data, but the original
1471+
* data must remain available until the stream is done with it, either by
1472+
* being read from the stream in its entirety, or a call to
1473+
* SDL_ClearAudioStream() or SDL_DestroyAudioStream().
1474+
*
1475+
* The data must match the format/channels/samplerate specified in the latest
1476+
* call to SDL_SetAudioStreamFormat, or the format specified when creating the
1477+
* stream if it hasn't been changed.
1478+
*
1479+
* An optional callback may be provided, which is called when the stream no
1480+
* longer needs the data. Once this callback fires, the stream will not access
1481+
* the data again. This callback will fire for any reason the data is no
1482+
* longer needed, including clearing or destroying the stream.
1483+
*
1484+
* Note that there is still an allocation to store tracking information, so
1485+
* this function is more efficient for larger blocks of data. If you're
1486+
* planning to put a few samples at a time, it will be more efficient to use
1487+
* SDL_PutAudioStreamData(), which allocates and buffers in blocks.
1488+
*
1489+
* \param stream the stream the audio data is being added to.
1490+
* \param buf a pointer to the audio data to add.
1491+
* \param len the number of bytes to add to the stream.
1492+
* \param callback the callback function to call when the data is no longer
1493+
* needed by the stream. May be NULL.
1494+
* \param userdata an opaque pointer provided to the callback for its own
1495+
* personal use.
1496+
* \returns true on success or false on failure; call SDL_GetError() for more
1497+
* information.
1498+
*
1499+
* \threadsafety It is safe to call this function from any thread, but if the
1500+
* stream has a callback set, the caller might need to manage
1501+
* extra locking.
1502+
*
1503+
* \since This function is available since SDL 3.4.0.
1504+
*
1505+
* \sa SDL_ClearAudioStream
1506+
* \sa SDL_FlushAudioStream
1507+
* \sa SDL_GetAudioStreamData
1508+
* \sa SDL_GetAudioStreamQueued
1509+
*/
1510+
extern SDL_DECLSPEC bool SDLCALL SDL_PutAudioStreamDataNoCopy(SDL_AudioStream *stream, const void *buf, int len, SDL_AudioStreamDataCompleteCallback callback, void *userdata);
1511+
1512+
/**
1513+
* Add data to the stream with each channel in a separate array.
1514+
*
1515+
* This data must match the format/channels/samplerate specified in the latest
1516+
* call to SDL_SetAudioStreamFormat, or the format specified when creating the
1517+
* stream if it hasn't been changed.
1518+
*
1519+
* The data will be interleaved and queued. Note that SDL_AudioStream only
1520+
* operates on interleaved data, so this is simply a convenience function for
1521+
* easily queueing data from sources that provide separate arrays. There is no
1522+
* equivalent function to retrieve planar data.
1523+
*
1524+
* The arrays in `channel_buffers` are ordered as they are to be interleaved;
1525+
* the first array will be the first sample in the interleaved data. Any
1526+
* individual array may be NULL; in this case, silence will be interleaved for
1527+
* that channel.
1528+
*
1529+
* `num_channels` specifies how many arrays are in `channel_buffers`. This can
1530+
* be used as a safety to prevent overflow, in case the stream format has
1531+
* changed elsewhere. If more channels are specified than the current input
1532+
* spec, they are ignored. If less channels are specified, the missing arrays
1533+
* are treated as if they are NULL (silence is written to those channels). If
1534+
* the count is -1, SDL will assume the array count matches the current input
1535+
* spec.
1536+
*
1537+
* Note that `num_samples` is the number of _samples per array_. This can also
1538+
* be thought of as the number of _sample frames_ to be queued. A value of 1
1539+
* with stereo arrays will queue two samples to the stream. This is different
1540+
* than SDL_PutAudioStreamData, which wants the size of a single array in
1541+
* bytes.
1542+
*
1543+
* \param stream the stream the audio data is being added to.
1544+
* \param channel_buffers a pointer to an array of arrays, one array per
1545+
* channel.
1546+
* \param num_channels the number of arrays in `channel_buffers` or -1.
1547+
* \param num_samples the number of _samples_ per array to write to the
1548+
* stream.
1549+
* \returns true on success or false on failure; call SDL_GetError() for more
1550+
* information.
1551+
*
1552+
* \threadsafety It is safe to call this function from any thread, but if the
1553+
* stream has a callback set, the caller might need to manage
1554+
* extra locking.
1555+
*
1556+
* \since This function is available since SDL 3.4.0.
1557+
*
1558+
* \sa SDL_ClearAudioStream
1559+
* \sa SDL_FlushAudioStream
1560+
* \sa SDL_GetAudioStreamData
1561+
* \sa SDL_GetAudioStreamQueued
1562+
*/
1563+
extern SDL_DECLSPEC bool SDLCALL SDL_PutAudioStreamPlanarData(SDL_AudioStream *stream, const void * const *channel_buffers, int num_channels, int num_samples);
1564+
14171565
/**
14181566
* Get converted/resampled data from the stream.
14191567
*
@@ -1583,8 +1731,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *str
15831731
* previously been paused. Once unpaused, any bound audio streams will begin
15841732
* to progress again, and audio can be generated.
15851733
*
1586-
* Remember, SDL_OpenAudioDeviceStream opens device in a paused state, so this
1587-
* function call is required for audio playback to begin on such device.
1734+
* SDL_OpenAudioDeviceStream opens audio devices in a paused state, so this
1735+
* function call is required for audio playback to begin on such devices.
15881736
*
15891737
* \param stream the audio stream associated with the audio device to resume.
15901738
* \returns true on success or false on failure; call SDL_GetError() for more
@@ -1717,7 +1865,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
17171865
* audio to the stream during this call; if needed, the request that triggered
17181866
* this callback will obtain the new data immediately.
17191867
*
1720-
* The callback's `approx_request` argument is roughly how many bytes of
1868+
* The callback's `additional_amount` argument is roughly how many bytes of
17211869
* _unconverted_ data (in the stream's input format) is needed by the caller,
17221870
* although this may overestimate a little for safety. This takes into account
17231871
* how much is already in the stream and only asks for any extra necessary to
@@ -1762,13 +1910,13 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *
17621910
* The callback can (optionally) call SDL_GetAudioStreamData() to obtain audio
17631911
* from the stream during this call.
17641912
*
1765-
* The callback's `approx_request` argument is how many bytes of _converted_
1766-
* data (in the stream's output format) was provided by the caller, although
1767-
* this may underestimate a little for safety. This value might be less than
1768-
* what is currently available in the stream, if data was already there, and
1769-
* might be less than the caller provided if the stream needs to keep a buffer
1770-
* to aid in resampling. Which means the callback may be provided with zero
1771-
* bytes, and a different amount on each call.
1913+
* The callback's `additional_amount` argument is how many bytes of
1914+
* _converted_ data (in the stream's output format) was provided by the
1915+
* caller, although this may underestimate a little for safety. This value
1916+
* might be less than what is currently available in the stream, if data was
1917+
* already there, and might be less than the caller provided if the stream
1918+
* needs to keep a buffer to aid in resampling. Which means the callback may
1919+
* be provided with zero bytes, and a different amount on each call.
17721920
*
17731921
* The callback may call SDL_GetAudioStreamAvailable to see the total amount
17741922
* currently available to read from the stream, instead of the total provided
@@ -1841,7 +1989,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream)
18411989
* Also unlike other functions, the audio device begins paused. This is to map
18421990
* more closely to SDL2-style behavior, since there is no extra step here to
18431991
* bind a stream to begin audio flowing. The audio device should be resumed
1844-
* with `SDL_ResumeAudioStreamDevice(stream);`
1992+
* with SDL_ResumeAudioStreamDevice().
18451993
*
18461994
* This function works with both playback and recording devices.
18471995
*

Xcode/iOS/SDL3.framework/Headers/SDL_begin_code.h

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@
261261
*
262262
* On compilers without restrict support, this is defined to nothing.
263263
*
264-
* \since This macro is available since SDL 3.2.0.
264+
* \since This macro is available since SDL 3.4.0.
265265
*/
266-
#define SDL_RESTRICT __restrict__
266+
#define SDL_RESTRICT __restrict
267267

268268
/**
269269
* Check if the compiler supports a given builtin functionality.
@@ -281,9 +281,61 @@
281281
*/
282282
#define SDL_HAS_BUILTIN(x) __has_builtin(x)
283283

284+
/**
285+
* A macro to specify data alignment.
286+
*
287+
* This informs the compiler that a given datatype or variable must be aligned
288+
* to a specific byte count.
289+
*
290+
* For example:
291+
*
292+
* ```c
293+
* // make sure this is struct is aligned to 16 bytes for SIMD access.
294+
* typedef struct {
295+
* float x, y, z, w;
296+
* } SDL_ALIGNED(16) MySIMDAlignedData;
297+
*
298+
* // make sure this one field in a struct is aligned to 16 bytes for SIMD access.
299+
* typedef struct {
300+
* SomeStuff stuff;
301+
* float position[4] SDL_ALIGNED(16);
302+
* SomeOtherStuff other_stuff;
303+
* } MyStruct;
304+
*
305+
* // make sure this variable is aligned to 32 bytes.
306+
* int SDL_ALIGNED(32) myval = 0;
307+
* ```
308+
*
309+
* Alignment is only guaranteed for things the compiler places: local
310+
* variables on the stack and global/static variables. To dynamically allocate
311+
* something that respects this alignment, use SDL_aligned_alloc() or some
312+
* other mechanism.
313+
*
314+
* On compilers without alignment support, this macro is defined to an invalid
315+
* symbol, to make it clear that the current compiler is likely to generate
316+
* incorrect code when it sees this macro.
317+
*
318+
* \param x the byte count to align to, so the data's address will be a
319+
* multiple of this value.
320+
*
321+
* \since This macro is available since SDL 3.4.0.
322+
*/
323+
#define SDL_ALIGNED(x) __attribute__((aligned(x)))
324+
284325
/* end of wiki documentation section. */
285326
#endif
286327

328+
/* `restrict` is from C99, but __restrict works with both Visual Studio and GCC. */
329+
#ifndef SDL_RESTRICT
330+
# if defined(restrict) || ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)))
331+
# define SDL_RESTRICT restrict
332+
# elif defined(_MSC_VER) || defined(__GNUC__) || defined(__clang__)
333+
# define SDL_RESTRICT __restrict
334+
# else
335+
# define SDL_RESTRICT
336+
# endif
337+
#endif
338+
287339
#ifndef SDL_HAS_BUILTIN
288340
#ifdef __has_builtin
289341
#define SDL_HAS_BUILTIN(x) __has_builtin(x)
@@ -389,7 +441,7 @@
389441
#endif /* SDL_FORCE_INLINE not defined */
390442

391443
#ifndef SDL_NORETURN
392-
#ifdef __GNUC__
444+
#if defined(__GNUC__)
393445
#define SDL_NORETURN __attribute__((noreturn))
394446
#elif defined(_MSC_VER)
395447
#define SDL_NORETURN __declspec(noreturn)
@@ -484,3 +536,18 @@
484536
#define SDL_ALLOC_SIZE2(p1, p2)
485537
#endif
486538
#endif /* SDL_ALLOC_SIZE2 not defined */
539+
540+
#ifndef SDL_ALIGNED
541+
#if defined(__clang__) || defined(__GNUC__)
542+
#define SDL_ALIGNED(x) __attribute__((aligned(x)))
543+
#elif defined(_MSC_VER)
544+
#define SDL_ALIGNED(x) __declspec(align(x))
545+
#elif defined(__cplusplus) && (__cplusplus >= 201103L)
546+
#define SDL_ALIGNED(x) alignas(x)
547+
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
548+
#define SDL_ALIGNED(x) _Alignas(x)
549+
#else
550+
#define SDL_ALIGNED(x) PLEASE_DEFINE_SDL_ALIGNED
551+
#endif
552+
#endif /* SDL_ALIGNED not defined */
553+

Xcode/iOS/SDL3.framework/Headers/SDL_endian.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x) { return x_but_byteswapped; }
486486
*
487487
* \since This function is available since SDL 3.2.0.
488488
*/
489-
SDL_FORCE_INLINE Uint32 SDL_Swap64(Uint64 x) { return x_but_byteswapped; }
489+
SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x) { return x_but_byteswapped; }
490490

491491
/**
492492
* Swap a 16-bit value from littleendian to native byte order.

0 commit comments

Comments
 (0)