Implement -Wswitch-default.
[cparser] / adt / xmalloc.h
1 /**
2  * @file
3  * @brief     More comfortable allocations.
4  * @author    Markus Armbruster
5  * @data      1999 by getting from fiasco
6  * @version   $Id$
7  * Copyright: (c) 1995, 1996 Markus Armbruster
8  * Licence:   This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
9  */
10 #ifndef _XMALLOC_H_
11 #define _XMALLOC_H_
12
13 #include <stdlib.h>
14 #include "config.h"
15
16 __attribute__((malloc))
17 void *xmalloc(size_t size);
18
19 __attribute__((malloc))
20 void *xcalloc(size_t num, size_t size);
21
22 void *xrealloc(void *ptr, size_t size);
23
24 __attribute__((malloc))
25 char *xstrdup(const char *str);
26
27 #define xfree(ptr)      free(ptr)
28
29 #endif