Update copyright info for 2008 (minishogi patches) and recent developments.
[gnushogi.git] / gnushogi / debug.h
1 /*
2  * FILE: debug.h
3  *
4  *       Various macros to help in debugging.
5  *
6  * ----------------------------------------------------------------------
7  * Copyright (c) 1993, 1994, 1995 Matthias Mutz
8  * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
9  * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation
10  *
11  * GNU SHOGI is based on GNU CHESS
12  *
13  * Copyright (c) 1988, 1989, 1990 John Stanback
14  * Copyright (c) 1992 Free Software Foundation
15  *
16  * This file is part of GNU SHOGI.
17  *
18  * GNU Shogi is free software; you can redistribute it and/or modify it
19  * under the terms of the GNU General Public License as published by the
20  * Free Software Foundation; either version 3 of the License,
21  * or (at your option) any later version.
22  *
23  * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT
24  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26  * for more details.
27  *
28  * You should have received a copy of the GNU General Public License along
29  * with GNU Shogi; see the file COPYING. If not, see
30  * <http://www.gnu.org/licenses/>.
31  * ----------------------------------------------------------------------
32  *
33  */
34
35 /* Some of this code requires gcc. */
36
37
38 #ifndef _DEBUG_H_
39 #define _DEBUG_H_
40
41 /*
42  * Define simple macros PRINT_ENTER and PRINT_EXIT to print info when
43  * a function is entered or left.  They only work if DEBUG is #defined.
44  * This requires gcc.  You have to invoke them with a semicolon after them,
45  * like this:
46  *
47  * PRINT_ENTER;
48  * PRINT_EXIT;
49  *
50  * This is so as not to screw up automatic indentation in emacs.
51  */
52
53 #if (defined __GNUC__)
54
55 #  define PRINT_ENTER printf("Entering function:  %s().\n", __FUNCTION__)
56 #  define PRINT_EXIT  printf("Exiting function:   %s().\n", __FUNCTION__)
57
58 #else
59
60 #  define PRINT_ENTER
61 #  define PRINT_EXIT
62
63 #endif  /* __GNUC__ */
64
65 /* Function inlining; not all C compilers support this. */
66 #if (!defined __GNUC__)
67 #  define inline
68 #endif
69
70 #endif  /* _DEBUG_H_ */
71