mirror of https://github.com/encounter/SDL.git
Added SDL_VARIABLE_LENGTH_ARRAY so this #ifdef is localized to one place.
This commit is contained in:
parent
68d7be3949
commit
8b960d4e0f
|
@ -26,6 +26,15 @@
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* This is for a variable-length array at the end of a struct:
|
||||||
|
struct x { int y; char z[SDL_VARIABLE_LENGTH_ARRAY]; };
|
||||||
|
Use this because GCC 2 needs different magic than other compilers. */
|
||||||
|
#if (defined(__GNUC__) && (__GNUC__ <= 2))
|
||||||
|
#define SDL_VARIABLE_LENGTH_ARRAY 1
|
||||||
|
#else
|
||||||
|
#define SDL_VARIABLE_LENGTH_ARRAY
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "dynapi/SDL_dynapi.h"
|
#include "dynapi/SDL_dynapi.h"
|
||||||
|
|
||||||
#if SDL_DYNAMIC_API
|
#if SDL_DYNAMIC_API
|
||||||
|
|
|
@ -105,11 +105,7 @@ typedef struct SDL_AudioDeviceItem
|
||||||
{
|
{
|
||||||
void *handle;
|
void *handle;
|
||||||
struct SDL_AudioDeviceItem *next;
|
struct SDL_AudioDeviceItem *next;
|
||||||
#if (defined(__GNUC__) && (__GNUC__ <= 2))
|
char name[SDL_VARIABLE_LENGTH_ARRAY];
|
||||||
char name[1]; /* actually variable length. */
|
|
||||||
#else
|
|
||||||
char name[];
|
|
||||||
#endif
|
|
||||||
} SDL_AudioDeviceItem;
|
} SDL_AudioDeviceItem;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue