File: xmalloc.h

package info (click to toggle)
kbd-chooser 1.68
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 896 kB
  • ctags: 281
  • sloc: ansic: 4,360; yacc: 777; lex: 131; makefile: 118; sh: 33
file content (24 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Error-free versions of some libc routines */


#include <stdlib.h>

#if defined(NDEBUG)

#define xmalloc(sz)      malloc(sz)
#define xrealloc(p,sz)   realloc(p,sz)
#define xstrdup(p)       strdup(p)
#define lkfatal(S)      do {} while(0)
#define lkfatal1(S1,S2) do {} while(0)
#define lkfatal0(S1,X)  do {} while(0)

#else

extern void *xmalloc(size_t sz);
extern void *xrealloc(void *p, size_t sz);
extern char *xstrdup(const char *p);
extern void lkfatal(const char *s);
extern void lkfatal1(const char *s, const char *s2);
extern void lkfatal0(const char *, int);

#endif