Merging upstream version 1.14.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
868b5312e8
commit
d6fd2fdea9
305 changed files with 20664 additions and 6099 deletions
18
util/cleanup.h
Normal file
18
util/cleanup.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef __CLEANUP_H
|
||||
#define __CLEANUP_H
|
||||
|
||||
#define __cleanup__(fn) __attribute__((cleanup(fn)))
|
||||
|
||||
#define DECLARE_CLEANUP_FUNC(name, type) \
|
||||
void name(type *__p)
|
||||
|
||||
#define DEFINE_CLEANUP_FUNC(name, type, free_fn)\
|
||||
DECLARE_CLEANUP_FUNC(name, type) \
|
||||
{ \
|
||||
if (*__p) \
|
||||
free_fn(*__p); \
|
||||
}
|
||||
|
||||
DECLARE_CLEANUP_FUNC(cleanup_charp, char *);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue