Skip to content

Commit 6cdf58a

Browse files
committed
Xcode: update macOS SDL3 framework headers as well
1 parent 5bc05da commit 6cdf58a

Some content is hidden

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

42 files changed

+1952
-419
lines changed

Xcode/macOS/SDL3.framework/Versions/A/Headers/SDL.h

Lines changed: 2 additions & 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.3.0
23+
* Main include header for the SDL library, version 3.3.3
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
@@ -42,6 +42,7 @@
4242
#include <SDL3/SDL_clipboard.h>
4343
#include <SDL3/SDL_cpuinfo.h>
4444
#include <SDL3/SDL_dialog.h>
45+
#include <SDL3/SDL_dlopennote.h>
4546
#include <SDL3/SDL_endian.h>
4647
#include <SDL3/SDL_error.h>
4748
#include <SDL3/SDL_events.h>

Xcode/macOS/SDL3.framework/Versions/A/Headers/SDL_assert.h

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,17 @@ extern "C" {
126126
*/
127127
#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner
128128

129-
#elif defined(_MSC_VER) && _MSC_VER >= 1310
129+
#elif defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1310)
130130
/* Don't include intrin.h here because it contains C++ code */
131131
extern void __cdecl __debugbreak(void);
132132
#define SDL_TriggerBreakpoint() __debugbreak()
133133
#elif defined(_MSC_VER) && defined(_M_IX86)
134134
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
135-
#elif defined(ANDROID) || defined(__SYMBIAN32__)
136-
#include <assert.h>
137-
#define SDL_TriggerBreakpoint() assert(0)
138135
#elif SDL_HAS_BUILTIN(__builtin_debugtrap)
139136
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
140137
#elif SDL_HAS_BUILTIN(__builtin_trap)
141138
#define SDL_TriggerBreakpoint() __builtin_trap()
142-
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
139+
#elif (defined(__GNUC__) || defined(__clang__) || defined(__TINYC__)) && (defined(__i386__) || defined(__x86_64__))
143140
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
144141
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
145142
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
@@ -179,12 +176,48 @@ extern "C" {
179176
# define SDL_FUNCTION "???"
180177
#endif
181178

179+
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
180+
182181
/**
183182
* A macro that reports the current file being compiled.
184183
*
184+
* This macro is only defined if it isn't already defined, so to override it
185+
* (perhaps with something that doesn't provide path information at all, so
186+
* build machine information doesn't leak into public binaries), apps can
187+
* define this macro before including SDL.h or SDL_assert.h.
188+
*
185189
* \since This macro is available since SDL 3.2.0.
186190
*/
191+
#define SDL_FILE __FILE_NAME__
192+
193+
#elif !defined(SDL_FILE)
194+
#ifdef __FILE_NAME__
195+
#define SDL_FILE __FILE_NAME__
196+
#else
187197
#define SDL_FILE __FILE__
198+
#endif
199+
#endif
200+
201+
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
202+
203+
/**
204+
* A macro that reports the current file being compiled, for use in
205+
* assertions.
206+
*
207+
* This macro is only defined if it isn't already defined, so to override it
208+
* (perhaps with something that doesn't provide path information at all, so
209+
* build machine information doesn't leak into public binaries), apps can
210+
* define this macro before including SDL_assert.h. For example, defining this
211+
* to `""` will make sure no source path information is included in asserts.
212+
*
213+
* \since This macro is available since SDL 3.4.0.
214+
*/
215+
#define SDL_ASSERT_FILE SDL_FILE
216+
217+
#elif !defined(SDL_ASSERT_FILE)
218+
#define SDL_ASSERT_FILE SDL_FILE
219+
#endif
220+
188221

189222
/**
190223
* A macro that reports the current line number of the file being compiled.
@@ -362,8 +395,8 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
362395
#define SDL_enabled_assert(condition) \
363396
do { \
364397
while ( !(condition) ) { \
365-
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
366-
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
398+
static struct SDL_AssertData sdl_assert_data = { false, 0, #condition, NULL, 0, NULL, NULL }; \
399+
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_ASSERT_FILE, SDL_LINE); \
367400
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
368401
continue; /* go again. */ \
369402
} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \

Xcode/macOS/SDL3.framework/Versions/A/Headers/SDL_atomic.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,24 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_SetAtomicU32(SDL_AtomicU32 *a, Uint32 v);
596596
*/
597597
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAtomicU32(SDL_AtomicU32 *a);
598598

599+
/**
600+
* Add to an atomic variable.
601+
*
602+
* This function also acts as a full memory barrier.
603+
*
604+
* ***Note: If you don't know what this function is for, you shouldn't use
605+
* it!***
606+
*
607+
* \param a a pointer to an SDL_AtomicU32 variable to be modified.
608+
* \param v the desired value to add or subtract.
609+
* \returns the previous value of the atomic variable.
610+
*
611+
* \threadsafety It is safe to call this function from any thread.
612+
*
613+
* \since This function is available since SDL 3.4.0.
614+
*/
615+
extern SDL_DECLSPEC Uint32 SDLCALL SDL_AddAtomicU32(SDL_AtomicU32 *a, int v);
616+
599617
/**
600618
* Set a pointer to a new value if it is currently an old value.
601619
*

Xcode/macOS/SDL3.framework/Versions/A/Headers/SDL_audio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt
13361336
* \threadsafety It is safe to call this function from any thread, as it holds
13371337
* a stream-specific mutex while running. Don't change the
13381338
* stream's format to have a different number of channels from a
1339-
* a different thread at the same time, though!
1339+
* different thread at the same time, though!
13401340
*
13411341
* \since This function is available since SDL 3.2.0.
13421342
*

Xcode/macOS/SDL3.framework/Versions/A/Headers/SDL_begin_code.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
* // make sure this one field in a struct is aligned to 16 bytes for SIMD access.
299299
* typedef struct {
300300
* SomeStuff stuff;
301-
* float position[4] SDL_ALIGNED(16);
301+
* float SDL_ALIGNED(16) position[4];
302302
* SomeOtherStuff other_stuff;
303303
* } MyStruct;
304304
*
@@ -431,7 +431,7 @@
431431
#endif /* SDL_INLINE not defined */
432432

433433
#ifndef SDL_FORCE_INLINE
434-
#ifdef _MSC_VER
434+
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
435435
#define SDL_FORCE_INLINE __forceinline
436436
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
437437
#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__

Xcode/macOS/SDL3.framework/Versions/A/Headers/SDL_camera.h

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ typedef struct SDL_CameraSpec
119119
int width; /**< Frame width */
120120
int height; /**< Frame height */
121121
int framerate_numerator; /**< Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) */
122-
int framerate_denominator; /**< Frame rate demoninator ((num / denom) == FPS, (denom / num) == duration in seconds) */
122+
int framerate_denominator; /**< Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) */
123123
} SDL_CameraSpec;
124124

125125
/**
@@ -136,6 +136,20 @@ typedef enum SDL_CameraPosition
136136
SDL_CAMERA_POSITION_BACK_FACING
137137
} SDL_CameraPosition;
138138

139+
/**
140+
* The current state of a request for camera access.
141+
*
142+
* \since This enum is available since SDL 3.4.0.
143+
*
144+
* \sa SDL_GetCameraPermissionState
145+
*/
146+
typedef enum SDL_CameraPermissionState
147+
{
148+
SDL_CAMERA_PERMISSION_STATE_DENIED = -1,
149+
SDL_CAMERA_PERMISSION_STATE_PENDING,
150+
SDL_CAMERA_PERMISSION_STATE_APPROVED,
151+
} SDL_CameraPermissionState;
152+
139153

140154
/**
141155
* Use this function to get the number of built-in camera drivers.
@@ -346,8 +360,9 @@ extern SDL_DECLSPEC SDL_Camera * SDLCALL SDL_OpenCamera(SDL_CameraID instance_id
346360
* on others the approval might be implicit and not alert the user at all.
347361
*
348362
* This function can be used to check the status of that approval. It will
349-
* return 0 if still waiting for user response, 1 if the camera is approved
350-
* for use, and -1 if the user denied access.
363+
* return SDL_CAMERA_PERMISSION_STATE_PENDING if waiting for user response,
364+
* SDL_CAMERA_PERMISSION_STATE_APPROVED if the camera is approved for use, and
365+
* SDL_CAMERA_PERMISSION_STATE_DENIED if the user denied access.
351366
*
352367
* Instead of polling with this function, you can wait for a
353368
* SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event
@@ -358,8 +373,9 @@ extern SDL_DECLSPEC SDL_Camera * SDLCALL SDL_OpenCamera(SDL_CameraID instance_id
358373
* SDL_CloseCamera() to dispose of it.
359374
*
360375
* \param camera the opened camera device to query.
361-
* \returns -1 if user denied access to the camera, 1 if user approved access,
362-
* 0 if no decision has been made yet.
376+
* \returns an SDL_CameraPermissionState value indicating if access is
377+
* granted, or `SDL_CAMERA_PERMISSION_STATE_PENDING` if the decision
378+
* is still pending.
363379
*
364380
* \threadsafety It is safe to call this function from any thread.
365381
*
@@ -368,7 +384,7 @@ extern SDL_DECLSPEC SDL_Camera * SDLCALL SDL_OpenCamera(SDL_CameraID instance_id
368384
* \sa SDL_OpenCamera
369385
* \sa SDL_CloseCamera
370386
*/
371-
extern SDL_DECLSPEC int SDLCALL SDL_GetCameraPermissionState(SDL_Camera *camera);
387+
extern SDL_DECLSPEC SDL_CameraPermissionState SDLCALL SDL_GetCameraPermissionState(SDL_Camera *camera);
372388

373389
/**
374390
* Get the instance ID of an opened camera.

Xcode/macOS/SDL3.framework/Versions/A/Headers/SDL_clipboard.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardText(const char *text);
106106
/**
107107
* Get UTF-8 text from the clipboard.
108108
*
109-
* This functions returns an empty string if there was not enough memory left
109+
* This function returns an empty string if there is not enough memory left
110110
* for a copy of the clipboard's content.
111111
*
112112
* \returns the clipboard text on success or an empty string on failure; call
@@ -155,7 +155,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetPrimarySelectionText(const char *text);
155155
/**
156156
* Get UTF-8 text from the primary selection.
157157
*
158-
* This functions returns an empty string if there was not enough memory left
158+
* This function returns an empty string if there is not enough memory left
159159
* for a copy of the primary selection's content.
160160
*
161161
* \returns the primary selection text on success or an empty string on
@@ -194,15 +194,14 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
194194
* clipboard is cleared or new data is set. The clipboard is automatically
195195
* cleared in SDL_Quit().
196196
*
197-
* \param userdata a pointer to provided user data.
197+
* \param userdata a pointer to the provided user data.
198198
* \param mime_type the requested mime-type.
199199
* \param size a pointer filled in with the length of the returned data.
200200
* \returns a pointer to the data for the provided mime-type. Returning NULL
201-
* or setting length to 0 will cause no data to be sent to the
202-
* "receiver". It is up to the receiver to handle this. Essentially
203-
* returning no data is more or less undefined behavior and may cause
204-
* breakage in receiving applications. The returned data will not be
205-
* freed so it needs to be retained and dealt with internally.
201+
* or setting the length to 0 will cause zero length data to be sent
202+
* to the "receiver", which should be able to handle this. The
203+
* returned data will not be freed, so it needs to be retained and
204+
* dealt with internally.
206205
*
207206
* \since This function is available since SDL 3.2.0.
208207
*
@@ -211,10 +210,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
211210
typedef const void *(SDLCALL *SDL_ClipboardDataCallback)(void *userdata, const char *mime_type, size_t *size);
212211

213212
/**
214-
* Callback function that will be called when the clipboard is cleared, or new
215-
* data is set.
213+
* Callback function that will be called when the clipboard is cleared, or
214+
* when new data is set.
216215
*
217-
* \param userdata a pointer to provided user data.
216+
* \param userdata a pointer to the provided user data.
218217
*
219218
* \since This function is available since SDL 3.2.0.
220219
*
@@ -231,15 +230,16 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
231230
* respond with the data for the requested mime-type.
232231
*
233232
* The size of text data does not include any terminator, and the text does
234-
* not need to be null terminated (e.g. you can directly copy a portion of a
233+
* not need to be null-terminated (e.g., you can directly copy a portion of a
235234
* document).
236235
*
237236
* \param callback a function pointer to the function that provides the
238237
* clipboard data.
239238
* \param cleanup a function pointer to the function that cleans up the
240239
* clipboard data.
241240
* \param userdata an opaque pointer that will be forwarded to the callbacks.
242-
* \param mime_types a list of mime-types that are being offered.
241+
* \param mime_types a list of mime-types that are being offered. SDL copies
242+
* the given list.
243243
* \param num_mime_types the number of mime-types in the mime_types list.
244244
* \returns true on success or false on failure; call SDL_GetError() for more
245245
* information.
@@ -269,10 +269,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback
269269
extern SDL_DECLSPEC bool SDLCALL SDL_ClearClipboardData(void);
270270

271271
/**
272-
* Get the data from clipboard for a given mime type.
272+
* Get the data from the clipboard for a given mime type.
273273
*
274274
* The size of text data does not include the terminator, but the text is
275-
* guaranteed to be null terminated.
275+
* guaranteed to be null-terminated.
276276
*
277277
* \param mime_type the mime type to read from the clipboard.
278278
* \param size a pointer filled in with the length of the returned data.
@@ -292,8 +292,8 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetClipboardData(const char *mime_type, s
292292
/**
293293
* Query whether there is data in the clipboard for the provided mime type.
294294
*
295-
* \param mime_type the mime type to check for data for.
296-
* \returns true if there exists data in clipboard for the provided mime type,
295+
* \param mime_type the mime type to check for data.
296+
* \returns true if data exists in the clipboard for the provided mime type,
297297
* false if it does not.
298298
*
299299
* \threadsafety This function should only be called on the main thread.
@@ -310,7 +310,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardData(const char *mime_type);
310310
*
311311
* \param num_mime_types a pointer filled with the number of mime types, may
312312
* be NULL.
313-
* \returns a null terminated array of strings with mime types, or NULL on
313+
* \returns a null-terminated array of strings with mime types, or NULL on
314314
* failure; call SDL_GetError() for more information. This should be
315315
* freed with SDL_free() when it is no longer needed.
316316
*

Xcode/macOS/SDL3.framework/Versions/A/Headers/SDL_cpuinfo.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,27 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
344344
*/
345345
extern SDL_DECLSPEC size_t SDLCALL SDL_GetSIMDAlignment(void);
346346

347+
/**
348+
* Report the size of a page of memory.
349+
*
350+
* Different platforms might have different memory page sizes. In current
351+
* times, 4 kilobytes is not unusual, but newer systems are moving to larger
352+
* page sizes, and esoteric platforms might have any unexpected size.
353+
*
354+
* Note that this function can return 0, which means SDL can't determine the
355+
* page size on this platform. It will _not_ set an error string to be
356+
* retrieved with SDL_GetError() in this case! In this case, defaulting to
357+
* 4096 is often a reasonable option.
358+
*
359+
* \returns the size of a single page of memory, in bytes, or 0 if SDL can't
360+
* determine this information.
361+
*
362+
* \threadsafety It is safe to call this function from any thread.
363+
*
364+
* \since This function is available since SDL 3.4.0.
365+
*/
366+
extern SDL_DECLSPEC int SDLCALL SDL_GetSystemPageSize(void);
367+
347368
/* Ends C function definitions when using C++ */
348369
#ifdef __cplusplus
349370
}

Xcode/macOS/SDL3.framework/Versions/A/Headers/SDL_dialog.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ typedef void (SDLCALL *SDL_DialogFileCallback)(void *userdata, const char * cons
139139
* it will be invoked.
140140
* \param window the window that the dialog should be modal for, may be NULL.
141141
* Not all platforms support this option.
142-
* \param filters a list of filters, may be NULL. Not all platforms support
143-
* this option, and platforms that do support it may allow the
144-
* user to ignore the filters. If non-NULL, it must remain
145-
* valid at least until the callback is invoked.
142+
* \param filters a list of filters, may be NULL. See the
143+
* [`SDL_DialogFileFilter`](SDL_DialogFileFilter#code-examples)
144+
* documentation for examples]. Not all platforms support this
145+
* option, and platforms that do support it may allow the user
146+
* to ignore the filters. If non-NULL, it must remain valid at
147+
* least until the callback is invoked.
146148
* \param nfilters the number of filters. Ignored if filters is NULL.
147149
* \param default_location the default folder or file to start the dialog at,
148150
* may be NULL. Not all platforms support this option.

0 commit comments

Comments
 (0)