-
Notifications
You must be signed in to change notification settings - Fork 3
/
exhaust.h
35 lines (27 loc) · 1.23 KB
/
exhaust.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* copyright 2002-2004 Bryce "Zooko" Wilcox-O'Hearn
* mailto:[email protected]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software to deal in this software without restriction (including the
* rights to use, modify, distribute, sublicense, and/or sell copies) provided
* that the above copyright notice and this permission notice is included in
* all copies or substantial portions of this software. THIS SOFTWARE IS
* PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
*/
#ifndef __INCL_exhaust_h
#define __INCL_exhaust_h
static char const* const exhaust_h_cvsid = "$Id: exhaust.h,v 1.5 2004/03/20 00:28:19 zooko Exp $";
static int const exhaust_vermaj = 0;
static int const exhaust_vermin = 9;
static int const exhaust_vermicro = 0;
static char const* const exhaust_vernum = "0.9.0";
void _z_printerr_and_exit(const char*const msg, const char*const filename, unsigned long lineno);
#define ERRNEXIT(msg) _z_printerr_and_exit((msg), __FILE__, __LINE__)
#define EXHAUSTERR(msg) ERRNEXIT("memory exhaustion: " msg " -- exiting")
#ifdef Z_EXHAUST_EXIT
#define CHECKMALLOC(x) if ((x) == NULL) EXHAUSTERR(#x)
#else
#define CHECKMALLOC(x)
#endif
#endif /* #ifndef __INCL_exhaust_h */