diff --git a/sc2/src/port.h b/sc2/src/port.h index 754fdfa9f..9aeb6155f 100644 --- a/sc2/src/port.h +++ b/sc2/src/port.h @@ -171,5 +171,11 @@ typedef unsigned int wint_t; # define VPRINTF_FUNCTION(formatArg) #endif +#if defined(__GNUC__) +# define _NORETURN __attribute__((noreturn)) +#else +# define _NORETURN +#endif + #endif /* _PORT_H */ diff --git a/sc2/src/sc2code/libs/compiler.h b/sc2/src/sc2code/libs/compiler.h index 66a3fe29d..adb65daa9 100644 --- a/sc2/src/sc2code/libs/compiler.h +++ b/sc2/src/sc2code/libs/compiler.h @@ -75,6 +75,7 @@ typedef DWORD (*PDWORDFUNC) (void); #define HIWORD(x) ((UWORD) ((DWORD) (x) >> 16)) +// To be moved to port.h: // _ALIGNED_ANY specifies an alignment suitable for any type // _ALIGNED_ON specifies a caller-supplied alignment (should be a power of 2) #if defined(__GNUC__) diff --git a/sc2/src/sc2code/libs/misc.h b/sc2/src/sc2code/libs/misc.h index ec435ffe8..9a603dd37 100644 --- a/sc2/src/sc2code/libs/misc.h +++ b/sc2/src/sc2code/libs/misc.h @@ -34,6 +34,8 @@ extern void *HRealloc (void *p, int size); extern int TFB_DEBUG_HALT; +static inline void explode (void) _NORETURN; + static inline void explode (void) { #ifdef DEBUG