mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Build type no longer defaults to Release (!) have separate options for extra warning flags and sanitizers toss DEVELOP macro Fix sanitizers with CMake while I'm at it :|
31 lines
665 B
C
31 lines
665 B
C
/*
|
|
* This file is part of RGBDS.
|
|
*
|
|
* Copyright (c) 2014-2020, RGBDS contributors.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef HELPERS_H
|
|
#define HELPERS_H
|
|
|
|
#ifdef __GNUC__
|
|
/* GCC or compatible */
|
|
#define format_(archetype, str_index, first_arg) \
|
|
__attribute__ ((format (archetype, str_index, first_arg)))
|
|
#define noreturn_ __attribute__ ((noreturn))
|
|
#define trap_ __builtin_trap()
|
|
#else
|
|
/* Unsupported, but no need to throw a fit */
|
|
#define format_(archetype, str_index, first_arg)
|
|
#define noreturn_
|
|
#define unused_
|
|
#define trap_
|
|
#endif
|
|
|
|
/* Macros for stringification */
|
|
#define STR(x) #x
|
|
#define EXPAND_AND_STR(x) STR(x)
|
|
|
|
#endif /* HELPERS_H */
|