1 /**\file
2  *\section License
3  * License: GPL
4  * Online License Link: http://www.gnu.org/licenses/gpl.html
5  *
6  *\author Copyright © 2003-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
7  *\author Copyright © 2007-2013 Daniel Swanson <danij@dengine.net>
8  *\author Copyright © 1993-1996 by id Software, Inc.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA  02110-1301  USA
24  */
25 
26 /**
27  * doomtype_.h: Simple basic typedefs, isolated here to make it easier
28  * separating modules.
29  */
30 
31 #ifndef __DOOMTYPE_H__
32 #define __DOOMTYPE_H__
33 
34 #ifndef __JDOOM64__
35 #  error "Using jDoom64 headers without __JDOOM64__"
36 #endif
37 
38 // Predefined with some OS.
39 #ifdef UNIX
40 
41 #include <limits.h>
42 
43 #define MAXCHAR     SCHAR_MAX
44 #define MAXSHORT    SHRT_MAX
45 #define MAXINT      INT_MAX
46 #define MAXLONG     LONG_MAX
47 
48 #define MINCHAR     SCHAR_MIN
49 #define MINSHORT    SHRT_MIN
50 #define MININT      INT_MIN
51 #define MINLONG     LONG_MIN
52 
53 #else /* not UNIX */
54 
55 #define MAXCHAR     ((char)0x7f)
56 #define MAXSHORT    ((short)0x7fff)
57 
58 // Max pos 32-bit int.
59 #define MAXINT      ((int)0x7fffffff)
60 #define MAXLONG     ((long)0x7fffffff)
61 #define MINCHAR     ((char)0x80)
62 #define MINSHORT    ((short)0x8000)
63 
64 // Max negative 32-bit integer.
65 #define MININT      ((int)0x80000000)
66 #define MINLONG     ((long)0x80000000)
67 #endif
68 
69 #endif
70