Skip to content

Commit 74245ed

Browse files
authored
bsp/simulator: improve Visual Studio 2012 project (#10253)
* bsp/simulator: update SDL2 Windows prebuilt binaries to 2.32.6 with x86 and x64 binaries * bsp/simulator: tidy and extend the Visual Studio 2012 project * bsp/simulator: fix format for SDL2 Windows headers
1 parent 0228779 commit 74245ed

File tree

107 files changed

+14475
-7404
lines changed

Some content is hidden

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

107 files changed

+14475
-7404
lines changed

bsp/simulator/SDL2/include/SDL.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2022 Sam Lantinga <[email protected]>
3+
Copyright (C) 1997-2025 Sam Lantinga <[email protected]>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -25,7 +25,6 @@
2525
* Main include header for the SDL library
2626
*/
2727

28-
2928
#ifndef SDL_h_
3029
#define SDL_h_
3130

@@ -41,6 +40,7 @@
4140
#include "SDL_events.h"
4241
#include "SDL_filesystem.h"
4342
#include "SDL_gamecontroller.h"
43+
#include "SDL_guid.h"
4444
#include "SDL_haptic.h"
4545
#include "SDL_hidapi.h"
4646
#include "SDL_hints.h"
@@ -69,6 +69,8 @@
6969
extern "C" {
7070
#endif
7171

72+
/* WIKI CATEGORY: Init */
73+
7274
/* As of version 0.5, SDL is loaded dynamically into the application */
7375

7476
/**
@@ -129,7 +131,7 @@ extern "C" {
129131
* call SDL_Quit() to force shutdown). If a subsystem is already loaded then
130132
* this call will increase the ref-count and return.
131133
*
132-
* \param flags subsystem initialization flags
134+
* \param flags subsystem initialization flags.
133135
* \returns 0 on success or a negative error code on failure; call
134136
* SDL_GetError() for more information.
135137
*
@@ -229,4 +231,4 @@ extern DECLSPEC void SDLCALL SDL_Quit(void);
229231

230232
#endif /* SDL_h_ */
231233

232-
/* vi: set ts=4 sw=4 expandtab: */
234+
/* vi: set ts=4 sw=4 expandtab: */

bsp/simulator/SDL2/include/SDL_assert.h

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2022 Sam Lantinga <[email protected]>
3+
Copyright (C) 1997-2025 Sam Lantinga <[email protected]>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -22,7 +22,7 @@
2222
#ifndef SDL_assert_h_
2323
#define SDL_assert_h_
2424

25-
#include "SDL_config.h"
25+
#include "SDL_stdinc.h"
2626

2727
#include "begin_code.h"
2828
/* Set up for C function definitions, even when using C++ */
@@ -51,14 +51,22 @@ assert can have unique static variables associated with it.
5151
/* Don't include intrin.h here because it contains C++ code */
5252
extern void __cdecl __debugbreak(void);
5353
#define SDL_TriggerBreakpoint() __debugbreak()
54+
#elif _SDL_HAS_BUILTIN(__builtin_debugtrap)
55+
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
5456
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
5557
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
58+
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
59+
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
5660
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
5761
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
5862
#elif defined(__APPLE__) && defined(__arm__)
5963
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
64+
#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
65+
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
6066
#elif defined(__386__) && defined(__WATCOMC__)
61-
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
67+
#define SDL_TriggerBreakpoint()
68+
{ _asm
69+
{ int 0x03 } }
6270
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
6371
#include <signal.h>
6472
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
@@ -69,7 +77,7 @@ assert can have unique static variables associated with it.
6977

7078
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
7179
# define SDL_FUNCTION __func__
72-
#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
80+
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
7381
# define SDL_FUNCTION __FUNCTION__
7482
#else
7583
# define SDL_FUNCTION "???"
@@ -123,12 +131,10 @@ typedef struct SDL_AssertData
123131
const struct SDL_AssertData *next;
124132
} SDL_AssertData;
125133

126-
#if (SDL_ASSERT_LEVEL > 0)
127-
128134
/* Never call this directly. Use the SDL_assert* macros. */
129135
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
130-
const char *,
131-
const char *, int)
136+
const char *,
137+
const char *, int)
132138
#if defined(__clang__)
133139
#if __has_feature(attribute_analyzer_noreturn)
134140
/* this tells Clang's static analysis that we're a custom assert function,
@@ -148,22 +154,21 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
148154
*/
149155
#define SDL_enabled_assert(condition) \
150156
do { \
151-
while ( !(condition) ) { \
152-
static struct SDL_AssertData sdl_assert_data = { \
153-
0, 0, #condition, 0, 0, 0, 0 \
154-
}; \
157+
while ( !(condition) )
158+
{ \
159+
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
155160
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
156-
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
161+
if (sdl_assert_state == SDL_ASSERTION_RETRY)
162+
{ \
157163
continue; /* go again. */ \
158-
} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
164+
} else if (sdl_assert_state == SDL_ASSERTION_BREAK)
165+
{ \
159166
SDL_TriggerBreakpoint(); \
160167
} \
161168
break; /* not retrying. */ \
162169
} \
163170
} while (SDL_NULL_WHILE_LOOP_CONDITION)
164171

165-
#endif /* enabled assertions support code */
166-
167172
/* Enable various levels of assertions. */
168173
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
169174
# define SDL_assert(condition) SDL_disabled_assert(condition)
@@ -193,8 +198,8 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
193198
* A callback that fires when an SDL assertion fails.
194199
*
195200
* \param data a pointer to the SDL_AssertData structure corresponding to the
196-
* current assertion
197-
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
201+
* current assertion.
202+
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
198203
* \returns an SDL_AssertState value indicating how to handle the failure.
199204
*/
200205
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
@@ -214,8 +219,8 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
214219
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
215220
*
216221
* \param handler the SDL_AssertionHandler function to call when an assertion
217-
* fails or NULL for the default handler
218-
* \param userdata a pointer that is passed to `handler`
222+
* fails or NULL for the default handler.
223+
* \param userdata a pointer that is passed to `handler`.
219224
*
220225
* \since This function is available since SDL 2.0.0.
221226
*
@@ -256,7 +261,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void
256261
* data, it is safe to pass a NULL pointer to this function to ignore it.
257262
*
258263
* \param puserdata pointer which is filled with the "userdata" pointer that
259-
* was passed to SDL_SetAssertionHandler()
264+
* was passed to SDL_SetAssertionHandler().
260265
* \returns the SDL_AssertionHandler that is called when an assert triggers.
261266
*
262267
* \since This function is available since SDL 2.0.2.
@@ -275,7 +280,8 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puse
275280
*
276281
* ```c
277282
* const SDL_AssertData *item = SDL_GetAssertionReport();
278-
* while (item) {
283+
* while (item)
284+
{
279285
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
280286
* item->condition, item->function, item->filename,
281287
* item->linenum, item->trigger_count,
@@ -321,4 +327,4 @@ extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
321327

322328
#endif /* SDL_assert_h_ */
323329

324-
/* vi: set ts=4 sw=4 expandtab: */
330+
/* vi: set ts=4 sw=4 expandtab: */

0 commit comments

Comments
 (0)