OSDN Git Service

68d0b9614f5ff96e6bf0c001542e3b24e5a9faca
[mingw/mingw-get.git] / src / debug.h
1 #ifndef DEBUG_H
2 /*
3  * debug.h
4  *
5  * $Id$
6  *
7  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
8  * Copyright (C) 2010, 2011, MinGW Project
9  *
10  *
11  * Hooks to facilitate conditional compilation of code to activate
12  * selective debugging features.
13  *
14  *
15  * This is free software.  Permission is granted to copy, modify and
16  * redistribute this software, under the provisions of the GNU General
17  * Public License, Version 3, (or, at your option, any later version),
18  * as published by the Free Software Foundation; see the file COPYING
19  * for licensing details.
20  *
21  * Note, in particular, that this software is provided "as is", in the
22  * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not
23  * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
24  * PARTICULAR PURPOSE.  Under no circumstances will the author, or the
25  * MinGW Project, accept liability for any damages, however caused,
26  * arising from the use of this software.
27  *
28  */
29 # define DEBUG_H  1
30
31  /* To facilitate identification of code which is added to assist
32   * in debugging, we explicitly define the DEBUG_INVOKED symbol; this
33   * explicitly expands to nothing, so that it may be incorporated
34   * as a transparent marker on any line of such code.
35   */
36 # define DEBUG_INVOKED
37
38 # if DEBUGLEVEL
39   /* Here, we provide definitions and declarations which allow us
40    * to selectively enable compilation of (any specific class of)
41    * debug specific code.
42    */
43 #  define DEBUG_TRACE_INIT                      0x0010
44 #  define DEBUG_TRACE_TRANSACTIONS              0x0020
45 #  define DEBUG_SUPPRESS_INSTALLATION           0x0040
46 #  define DEBUG_UPDATE_INVENTORY                0x0080
47
48 #  define DEBUG_TRACE_INTERNET_REQUESTS         0x0100
49
50 #  define DEBUG_INHIBIT_RITES_OF_PASSAGE        0x7000
51 #  define DEBUG_FAIL_FILE_RENAME_RITE           0x1000
52 #  define DEBUG_FAIL_FILE_UNLINK_RITE           0x2000
53
54 #  define DEBUG_INVOKE_IF( TEST, ACTION )       if( TEST ) ACTION
55
56 # else /* DEBUGLEVEL == 0 */
57   /* We use this space to provide any declarations which may be
58    * necessary to disable compilation of debug specific code...
59    */
60 #  define DEBUG_INVOKE_IF( TEST, ACTION )       /* DO NOTHING */
61
62 # endif /* DEBUGLEVEL */
63
64 #endif /* DEBUG_H: $RCSfile$: end of file */