poser
A C framework for POsix SERvices
Loading...
Searching...
No Matches
decl.h
1#ifndef POSER_DECL_H
2#define POSER_DECL_H
3
4#undef poser___cdecl
5#undef SOEXPORT
6#undef SOLOCAL
7#undef DECLEXPORT
8
9#define ATTR_ACCESS(x)
10#define ATTR_ALLOCSZ(x)
11#define ATTR_CONST
12#define ATTR_FALLTHROUGH
13#define ATTR_FORMAT(x)
14#define ATTR_MALLOC
15#define ATTR_NONNULL(x)
16#define ATTR_NORETURN
17#define ATTR_RETNONNULL
18#define ATTR_PURE
19#define CMETHOD
20
21#ifdef __cplusplus
22# define poser___cdecl extern "C"
23# define DECLDATA
24# define C_CLASS_DECL(t) struct t
25#else
26# define poser___cdecl
27# define DECLDATA extern
28# define C_CLASS_DECL(t) typedef struct t t
29#endif
30
31#if defined __has_attribute
32# if __has_attribute (access)
33# undef ATTR_ACCESS
34# define ATTR_ACCESS(x) __attribute__ ((access x))
35# endif
36# if __has_attribute (alloc_size)
37# undef ATTR_ALLOCSZ
38# define ATTR_ALLOCSZ(x) __attribute__ ((alloc_size x))
39# endif
40# if __has_attribute (const)
41# undef ATTR_CONST
42# define ATTR_CONST __attribute__ ((const))
43# endif
44# if __has_attribute (fallthrough)
45# undef ATTR_FALLTHROUGH
46# define ATTR_FALLTHROUGH __attribute__ ((fallthrough))
47# endif
48# if __has_attribute (format)
49# undef ATTR_FORMAT
50# define ATTR_FORMAT(x) __attribute__ ((format x))
51# endif
52# if __has_attribute (malloc)
53# undef ATTR_MALLOC
54# define ATTR_MALLOC __attribute__ ((malloc))
55# endif
56# if __has_attribute (nonnull)
57# undef ATTR_NONNULL
58# undef CMETHOD
59# define ATTR_NONNULL(x) __attribute__ ((nonnull x))
60# define CMETHOD __attribute__ ((nonnull (1)))
61# endif
62# if __has_attribute (noreturn)
63# undef ATTR_NORETURN
64# define ATTR_NORETURN __attribute__ ((noreturn))
65# endif
66# if __has_attribute (returns_nonnull)
67# undef ATTR_RETNONNULL
68# define ATTR_RETNONNULL __attribute__ ((returns_nonnull))
69# endif
70# if __has_attribute (pure)
71# undef ATTR_PURE
72# define ATTR_PURE __attribute__ ((pure))
73# endif
74# if __has_attribute (visibility)
75# define SOEXPORT poser___cdecl __attribute__((visibility("default")))
76# define SOLOCAL __attribute__((visibility("hidden")))
77# else
78# define SOEXPORT poser___cdecl
79# define SOLOCAL
80# endif
81#endif
82#define DECLEXPORT poser___cdecl
83
84#endif