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#define OBSOLETE(x)
21
22#ifdef __cplusplus
23# define poser___cdecl extern "C"
24# define DECLDATA
25# define C_CLASS_DECL(t) struct t
26#else
27# define poser___cdecl
28# define DECLDATA extern
29# define C_CLASS_DECL(t) typedef struct t t
30#endif
31
32#if defined __has_attribute
33# if __has_attribute (access)
34# undef ATTR_ACCESS
35# define ATTR_ACCESS(x) __attribute__ ((access x))
36# endif
37# if __has_attribute (alloc_size)
38# undef ATTR_ALLOCSZ
39# define ATTR_ALLOCSZ(x) __attribute__ ((alloc_size x))
40# endif
41# if __has_attribute (const)
42# undef ATTR_CONST
43# define ATTR_CONST __attribute__ ((const))
44# endif
45# if __has_attribute (fallthrough)
46# undef ATTR_FALLTHROUGH
47# define ATTR_FALLTHROUGH __attribute__ ((fallthrough))
48# endif
49# if __has_attribute (format)
50# undef ATTR_FORMAT
51# define ATTR_FORMAT(x) __attribute__ ((format x))
52# endif
53# if __has_attribute (malloc)
54# undef ATTR_MALLOC
55# define ATTR_MALLOC __attribute__ ((malloc))
56# endif
57# if __has_attribute (nonnull)
58# undef ATTR_NONNULL
59# undef CMETHOD
60# define ATTR_NONNULL(x) __attribute__ ((nonnull x))
61# define CMETHOD __attribute__ ((nonnull (1)))
62# endif
63# if __has_attribute (noreturn)
64# undef ATTR_NORETURN
65# define ATTR_NORETURN __attribute__ ((noreturn))
66# endif
67# if __has_attribute (returns_nonnull)
68# undef ATTR_RETNONNULL
69# define ATTR_RETNONNULL __attribute__ ((returns_nonnull))
70# endif
71# if __has_attribute (pure)
72# undef ATTR_PURE
73# define ATTR_PURE __attribute__ ((pure))
74# endif
75# if __has_attribute (visibility)
76# define SOEXPORT poser___cdecl __attribute__((visibility("default")))
77# define SOLOCAL __attribute__((visibility("hidden")))
78# else
79# define SOEXPORT poser___cdecl
80# define SOLOCAL
81# endif
82# if __has_attribute (deprecated)
83# undef OBSOLETE
84# define OBSOLETE(x) __attribute__ ((deprecated ( #x )))
85# endif
86#endif
87#define DECLEXPORT poser___cdecl
88
89#endif