Import sendmail 8.13.7
[dragonfly.git] / contrib / sendmail-8.13.7 / include / sm / xtrap.h
blob2e7e71721b2f41502db3acebd0a7eb0e75a04e6a
1 /*
2 * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
9 * $Id: xtrap.h,v 1.7 2001/04/03 01:53:01 gshapiro Exp $
13 ** scaffolding for testing exception handler code
16 #ifndef SM_XTRAP_H
17 # define SM_XTRAP_H
19 # include <sm/debug.h>
20 # include <sm/exc.h>
22 extern SM_ATOMIC_UINT_T SmXtrapCount;
23 extern SM_DEBUG_T SmXtrapDebug;
24 extern SM_DEBUG_T SmXtrapReport;
26 # if SM_DEBUG_CHECK
27 # define sm_xtrap_check() (++SmXtrapCount == sm_debug_level(&SmXtrapDebug))
28 # else /* SM_DEBUG_CHECK */
29 # define sm_xtrap_check() (0)
30 # endif /* SM_DEBUG_CHECK */
32 # define sm_xtrap_raise_x(exc) \
33 if (sm_xtrap_check()) \
34 { \
35 sm_exc_raise_x(exc); \
36 } else
38 #endif /* ! SM_XTRAP_H */