]> git.cworth.org Git - ttt/blob - src/ttt.h
0f2f7e55782f7e7ac54a8bf85daaf0c8795bc64b
[ttt] / src / ttt.h
1 /* ttt.h - client-server tic-tac-toe game
2  *
3  * Copyright © 2005 Carl Worth
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2, or (at your option)
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  *
19  * Author: Carl Worth <cworth@cworth.org>
20  */
21
22 #ifndef TTT_H
23 #define TTT_H
24
25 #ifdef HAVE_CONFIG_H
26 #include "config.h"
27 #endif
28
29 /* We use _GNU_SOURCE to get things like asprintf. */
30 #define _GNU_SOURCE
31 #include <stdio.h>
32 #include <stdlib.h>
33 #include <unistd.h>
34 #include <assert.h>
35 #include <string.h>
36 #include <errno.h>
37 #include <ctype.h>
38
39 #define ASSERT_NOT_REACHED              \
40 do {                                    \
41     static const int NOT_REACHED = 0;   \
42     assert (NOT_REACHED);               \
43     exit (1);                           \
44 } while (0)
45
46 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
47 #define TTT_PRINTF_FORMAT(fmt_index, va_index) \
48         __attribute__((__format__(__printf__, fmt_index, va_index)))
49 #else
50 #define TTT_PRINTF_FORMAT(fmt_index, va_index)
51 #endif
52
53 #include "ttt-args.h"
54 #include "x.h"
55
56 #endif