shithub: rgbds

ref: ffdb1fbfe5e74ba9015ffaf0285f61a8e71d95b1
dir: /include/helpers.h/

View raw version
/*
 * This file is part of RGBDS.
 *
 * Copyright (c) 2014-2018, 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

#ifndef DEVELOP
	#define DEVELOP 0
#endif

#endif /* HELPERS_H */