|
@@ -1302,8 +1302,9 @@ extern "C" {
|
|
|
/**
|
|
/**
|
|
|
* Free memory previously allocated with SDL_stack_alloc.
|
|
* Free memory previously allocated with SDL_stack_alloc.
|
|
|
*
|
|
*
|
|
|
- * If SDL used alloca() to allocate this memory, this macro does nothing and
|
|
|
|
|
- * the allocated memory will be automatically released when the function that
|
|
|
|
|
|
|
+ * If SDL used alloca() to allocate this memory, this macro does nothing (other
|
|
|
|
|
+ * than insert `((void)(data)` so the compiler sees an expression) and the
|
|
|
|
|
+ * allocated memory will be automatically released when the function that
|
|
|
* called SDL_stack_alloc() returns. If SDL used SDL_malloc(), it will
|
|
* called SDL_stack_alloc() returns. If SDL used SDL_malloc(), it will
|
|
|
* SDL_free the memory immediately.
|
|
* SDL_free the memory immediately.
|
|
|
*
|
|
*
|
|
@@ -1315,7 +1316,7 @@ extern "C" {
|
|
|
*
|
|
*
|
|
|
* \sa SDL_stack_alloc
|
|
* \sa SDL_stack_alloc
|
|
|
*/
|
|
*/
|
|
|
-#define SDL_stack_free(data)
|
|
|
|
|
|
|
+#define SDL_stack_free(data) ((void)(data))
|
|
|
#elif !defined(SDL_DISABLE_ALLOCA)
|
|
#elif !defined(SDL_DISABLE_ALLOCA)
|
|
|
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
|
|
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
|
|
|
#define SDL_stack_free(data) ((void)(data))
|
|
#define SDL_stack_free(data) ((void)(data))
|