21#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
22# define RPM_GNUC_EXTENSION __extension__
24# define RPM_GNUC_EXTENSION
29#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
30#define RPM_GNUC_PURE \
31 __attribute__((__pure__))
32#define RPM_GNUC_MALLOC \
33 __attribute__((__malloc__))
36#define RPM_GNUC_MALLOC
39#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
40#define RPM_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
41#define RPM_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
43#define RPM_GNUC_ALLOC_SIZE(x)
44#define RPM_GNUC_ALLOC_SIZE2(x,y)
48#define RPM_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
50#define RPM_GNUC_NULL_TERMINATED
53#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
54#define RPM_GNUC_PRINTF( format_idx, arg_idx ) \
55 __attribute__((__format__ (__printf__, format_idx, arg_idx)))
56#define RPM_GNUC_SCANF( format_idx, arg_idx ) \
57 __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
58#define RPM_GNUC_FORMAT( arg_idx ) \
59 __attribute__((__format_arg__ (arg_idx)))
60#define RPM_GNUC_NORETURN \
61 __attribute__((__noreturn__))
62#define RPM_GNUC_CONST \
63 __attribute__((__const__))
64#define RPM_GNUC_UNUSED \
65 __attribute__((__unused__))
66#define RPM_GNUC_NO_INSTRUMENT \
67 __attribute__((__no_instrument_function__))
69#define RPM_GNUC_PRINTF( format_idx, arg_idx )
70#define RPM_GNUC_SCANF( format_idx, arg_idx )
71#define RPM_GNUC_FORMAT( arg_idx )
72#define RPM_GNUC_NORETURN
74#define RPM_GNUC_UNUSED
75#define RPM_GNUC_NO_INSTRUMENT
78#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
79#define RPM_GNUC_DEPRECATED \
80 __attribute__((__deprecated__))
82#define RPM_GNUC_DEPRECATED
85#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
86#define RPM_GNUC_MAY_ALIAS __attribute__((may_alias))
87#define RPM_GNUC_NONNULL( ... ) \
88 __attribute__((__nonnull__ (__VA_ARGS__)))
90#define RPM_GNUC_MAY_ALIAS
91#define RPM_GNUC_NONNULL( ... )
94#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
95#define RPM_GNUC_WARN_UNUSED_RESULT \
96 __attribute__((warn_unused_result))
98#define RPM_GNUC_WARN_UNUSED_RESULT
101#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
102# define RPM_GNUC_INTERNAL __attribute__((visibility("hidden")))
104# define RPM_GNUC_INTERNAL
110# define RPM_BEGIN_DECLS extern "C" {
111# define RPM_END_DECLS }
113# define RPM_BEGIN_DECLS
114# define RPM_END_DECLS
122RPM_GNUC_MALLOC RPM_GNUC_ALLOC_SIZE(1)
124void * rmalloc(
size_t size);
126RPM_GNUC_MALLOC RPM_GNUC_ALLOC_SIZE2(1,2)
128void * rcalloc(
size_t nmemb,
size_t size);
131RPM_GNUC_MALLOC RPM_GNUC_ALLOC_SIZE2(2,3)
133void * rreallocn(
void * ptr,
size_t nmemb,
size_t size);
135RPM_GNUC_ALLOC_SIZE(2)
137void * rrealloc(
void *ptr,
size_t size);
140char * rstrdup(const
char *str);
143char * rstrndup(const
char *str,
size_t n);
147void * rfree(
void *ptr);
151const
char *rgetprogname(
void);
153void rsetprogname(const
char *pn);
RPM_PUBLIC_API rpmMemFailFunc rpmSetMemFail(rpmMemFailFunc func, void *data)
void *(* rpmMemFailFunc)(size_t size, void *data)
Definition rpmutil.h:166