libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
funcattr.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2014 Karlsruhe Institute of Technology
4  */
5 
11 #ifndef FIRM_FUNCATTR_H
12 #define FIRM_FUNCATTR_H
13 
20 #ifdef __cplusplus
21 # define FIRM_NOTHROW throw ()
22 #else
23 # define FIRM_NOTHROW
24 #endif
25 
31 #ifdef __GNUC__
32 # define FIRM_PRINTF(a,b) __attribute__((__format__(__printf__, a, b)))
33 #else
34 # define FIRM_PRINTF(a,b)
35 #endif
36 
41 #if defined(__GNUC__) && __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70)
42 # define FIRM_NORETURN __attribute__((__noreturn__)) void
43 #elif defined(__STDC__) && (__STDC_VERSION__ >= 201112L)
44 # define FIRM_NORETURN _Noreturn void
45 #elif defined(_MSC_VER)
46 # define FIRM_NORETURN void __declspec(noreturn)
47 #else
48 # define FIRM_NORETURN void
49 #endif
50 
59 #if defined(__GNUC__) && __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70)
60 # define FIRM_NORETURN_FUNCPTR __attribute__((__noreturn__)) void
61 #else
62 # define FIRM_NORETURN_FUNCPTR void
63 #endif
64 
65 #endif