3 * File name: ir/common/error.h
4 * Purpose: Error handling for libFirm
9 * Copyright: (C) 1998-2006 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
18 * Error handling for libFirm.
20 * @author Michael Beck
23 /* define a NORETURN attribute */
25 # if defined(__GNUC__)
26 # if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70)
27 # define NORETURN void __attribute__ ((noreturn))
28 # endif /* __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70) */
29 # endif /* defined(__GNUC__) */
31 # if defined(_MSC_VER)
32 # define NORETURN void __declspec(noreturn)
33 # endif /* defined(_MSC_VER) */
35 /* If not set above, use "void" for DOES_NOT_RETURN. */
37 # define NORETURN void
38 # endif /* ifndef NORETURN */
39 #endif /* ifndef NORETURN */
42 * Prints a panic message to stderr and exits.
44 NORETURN panic(const char *fmt, ...);
46 # endif /*_ERROR_H_ */