Removing function macro SDL_TABLESIZE()

This commit is contained in:
Petar Popovic
2024-04-29 14:38:56 +02:00
committed by Sam Lantinga
parent 8d0ad44edd
commit 7bfecacc02
10 changed files with 24 additions and 14 deletions

View File

@@ -492,6 +492,7 @@
#define SDL_SensorUpdate SDL_UpdateSensors
/* ##SDL_stdinc.h */
#define SDL_TABLESIZE SDL_arraysize
#define SDL_strtokr SDL_strtok_r
/* ##SDL_surface.h */
@@ -999,6 +1000,7 @@
#define SDL_SensorUpdate SDL_SensorUpdate_renamed_SDL_UpdateSensors
/* ##SDL_stdinc.h */
#define SDL_TABLESIZE SDL_TABLESIZE_renamed_SDL_arraysize
#define SDL_strtokr SDL_strtokr_renamed_SDL_strtok_r
/* ##SDL_surface.h */

View File

@@ -91,10 +91,11 @@ void *alloca(size_t);
/**
* The number of elements in an array.
*
* NOTE: This macro double-evaluates the argument, so you should never have side effects in the parameter.
*
* \since This macro is available since SDL 3.0.0.
*/
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
#define SDL_TABLESIZE(table) SDL_arraysize(table)
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
/**
* Macro useful for building other macros with strings in them.