1 /* Debugging aids -- togglable assertions.
2 Copyright (C) 1994 Free Software Foundation, Inc.
4 This file is part of SXEmacs
6 SXEmacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 SXEmacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* Synched up with: Not in FSF. */
22 /* Written by Chuck Thompson */
24 #ifndef INCLUDED_debug_h_
25 #define INCLUDED_debug_h_
27 #define DEBUG_STDERR 1
34 struct debug_classes {
35 unsigned int redisplay:1;
36 unsigned int buffers:1;
37 unsigned int extents:1;
39 unsigned int windows:1;
40 unsigned int frames:1;
41 unsigned int devices:1;
42 unsigned int byte_code:1;
44 unsigned int types_of_redisplay;
45 unsigned int types_of_buffers;
46 unsigned int types_of_extents;
47 unsigned int types_of_faces;
48 unsigned int types_of_windows;
49 unsigned int types_of_frames;
50 unsigned int types_of_devices;
51 unsigned int types_of_byte_code;
54 extern struct debug_classes active_debug_classes;
56 #define DASSERT(class, desired_type, action, assertion) do \
58 if (active_debug_classes.##class \
59 && (active_debug_classes.types_of_##class & desired_type)) \
63 if (action == DEBUG_STDERR) \
64 stderr_out ("Assertion failed in %s at line %d\n", \
65 __FILE__, __LINE__); \
71 #else /* !DEBUG_SXEMACS */
73 #define DASSERT(class, desired_type, action, assertion) ((void) 0)
75 #endif /* !DEBUG_SXEMACS */
77 #endif /* INCLUDED_debug_h_ */