src
assert.h
1
/*
2
shm-arena shared memory arena
3
Copyright (C) 2006-2008 Lance Arsenault (LGPL v3)
4
5
6
This file is part of shm-arena.
7
8
shm-arena is free software; you can redistribute it and/or modify
9
it under the terms of the GNU Lesser General Public License as
10
published by the Free Software Foundation; either version 3 of the
11
License, or (at your option) any later version.
12
13
shm-arena is distributed in the hope that it will be useful, but
14
WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public
19
License along with this program. If not, see
20
<http://www.gnu.org/licenses/>.
21
*/
22
23
#ifdef SHM_DEBUG
24
25
# define ASSERT(x) \
26
do \
27
{ \
28
if(!(x)) \
29
{ \
30
SPEW(_WARN, __FILE__":%d %s() ASSERTED (" #x ")\n" \
31
"pid= %d try running: gdb --pid %d" \
32
,__LINE__, __func__, getpid(), getpid()); \
33
while(1) sleep(1); \
34
} \
35
} \
36
while(0)
37
38
#else
39
40
# define ASSERT(x)
/* empty macro */
41
42
#endif
Shared Memory Arena version RC-0.0.25