]> wimlib.net Git - wimlib/blob - include/wimlib/compiler.h
Refactor headers
[wimlib] / include / wimlib / compiler.h
1 #ifndef _WIMLIB_COMPILER_H
2 #define _WIMLIB_COMPILER_H
3
4 #ifdef __GNUC__
5 #       if defined(__CYGWIN__) || defined(__WIN32__)
6 #               define WIMLIBAPI __declspec(dllexport)
7 #       else
8 #               define WIMLIBAPI __attribute__((visibility("default")))
9 #       endif
10 #       define ALWAYS_INLINE inline __attribute__((always_inline))
11 #       define PACKED __attribute__((packed))
12 #       define FORMAT(type, format_str, args_start) \
13                         /*__attribute__((format(type, format_str, args_start))) */
14 #       if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
15 #               define COLD     __attribute__((cold))
16 #       else
17 #               define COLD
18 #       endif
19 #else
20 #       define WIMLIBAPI
21 #       define ALWAYS_INLINE inline
22 #       define FORMAT(type, format_str, args_start)
23 #       define COLD
24 #       define PACKED
25 #endif /* __GNUC__ */
26
27 #endif /* _WIMLIB_COMPILER_H */