mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-09 10:29:45 +01:00
Use SDL_FALLTHROUGH
if available
The SDL_FALLTHROUGH macro has been added to SDL 2.0.18. Until 2.0.18 is released, use it if it's available.
This commit is contained in:
parent
0c1f756af8
commit
cd15ae0fdc
3 changed files with 24 additions and 11 deletions
|
@ -12,6 +12,7 @@
|
||||||
#include "Map.h"
|
#include "Map.h"
|
||||||
#include "Music.h"
|
#include "Music.h"
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
|
#include "TempSDLFallthrough.h"
|
||||||
#include "UtilityClass.h"
|
#include "UtilityClass.h"
|
||||||
#include "Vlogging.h"
|
#include "Vlogging.h"
|
||||||
|
|
||||||
|
@ -591,7 +592,7 @@ bool Graphics::next_wrap(
|
||||||
break;
|
break;
|
||||||
case '\n':
|
case '\n':
|
||||||
*start += 1;
|
*start += 1;
|
||||||
VVV_fallthrough;
|
SDL_FALLTHROUGH;
|
||||||
case '\0':
|
case '\0':
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
22
desktop_version/src/TempSDLFallthrough.h
Normal file
22
desktop_version/src/TempSDLFallthrough.h
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#ifndef TEMPSDLFALLTHROUGH_H
|
||||||
|
#define TEMPSDLFALLTHROUGH_H
|
||||||
|
|
||||||
|
/* FIXME: Delete this when SDL 2.0.18 releases! */
|
||||||
|
|
||||||
|
#include <SDL_stdinc.h>
|
||||||
|
|
||||||
|
#ifndef SDL_FALLTHROUGH
|
||||||
|
# ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) 0
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if __has_attribute(__fallthrough__)
|
||||||
|
# define VVV_fallthrough __attribute__((__fallthrough__))
|
||||||
|
# else
|
||||||
|
# define VVV_fallthrough do { } while (false) /* fallthrough */
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# define SDL_FALLTHROUGH VVV_fallthrough
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* TEMPSDLFALLTHROUGH_H */
|
|
@ -68,16 +68,6 @@ void _VVV_between(
|
||||||
sizeof(middle) \
|
sizeof(middle) \
|
||||||
)
|
)
|
||||||
|
|
||||||
#ifndef __has_attribute
|
|
||||||
# define __has_attribute(x) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __has_attribute(__fallthrough__)
|
|
||||||
# define VVV_fallthrough __attribute__((__fallthrough__))
|
|
||||||
#else
|
|
||||||
# define VVV_fallthrough do { } while (false) /* fallthrough */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAYBE_FAIL(expr) \
|
#define MAYBE_FAIL(expr) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
|
|
Loading…
Reference in a new issue