1290001Sglebius/*
2290001Sglebius * Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
3290001Sglebius * Copyright (C) 1999-2001  Internet Software Consortium.
4290001Sglebius *
5290001Sglebius * Permission to use, copy, modify, and/or distribute this software for any
6290001Sglebius * purpose with or without fee is hereby granted, provided that the above
7290001Sglebius * copyright notice and this permission notice appear in all copies.
8290001Sglebius *
9290001Sglebius * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10290001Sglebius * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11290001Sglebius * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12290001Sglebius * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13290001Sglebius * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14290001Sglebius * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15290001Sglebius * PERFORMANCE OF THIS SOFTWARE.
16290001Sglebius */
17290001Sglebius
18290001Sglebius/* $Id: int.h,v 1.13 2007/06/19 23:47:20 tbox Exp $ */
19290001Sglebius
20290001Sglebius#ifndef ISC_INT_H
21290001Sglebius#define ISC_INT_H 1
22290001Sglebius
23290001Sglebius#define _INTEGRAL_MAX_BITS 64
24290001Sglebius#include <limits.h>
25290001Sglebius
26290001Sglebiustypedef __int8				isc_int8_t;
27290001Sglebiustypedef unsigned __int8			isc_uint8_t;
28290001Sglebiustypedef __int16				isc_int16_t;
29290001Sglebiustypedef unsigned __int16		isc_uint16_t;
30290001Sglebiustypedef __int32				isc_int32_t;
31290001Sglebiustypedef unsigned __int32		isc_uint32_t;
32290001Sglebiustypedef __int64				isc_int64_t;
33290001Sglebiustypedef unsigned __int64		isc_uint64_t;
34290001Sglebius
35290001Sglebius#define ISC_INT8_MIN	-128
36290001Sglebius#define ISC_INT8_MAX	127
37290001Sglebius#define ISC_UINT8_MAX	255
38290001Sglebius
39290001Sglebius#define ISC_INT16_MIN	-32768
40290001Sglebius#define ISC_INT16_MAX	32767
41290001Sglebius#define ISC_UINT16_MAX	65535
42290001Sglebius
43290001Sglebius/*
44290001Sglebius * Note that "int" is 32 bits on all currently supported Unix-like operating
45290001Sglebius * systems, but "long" can be either 32 bits or 64 bits, thus the 32 bit
46290001Sglebius * constants are not qualified with "L".
47290001Sglebius */
48290001Sglebius#define ISC_INT32_MIN	_I32_MIN
49290001Sglebius#define ISC_INT32_MAX	_I32_MAX
50290001Sglebius#define ISC_UINT32_MAX	_UI32_MAX
51290001Sglebius
52290001Sglebius#define ISC_INT64_MIN	_I64_MIN
53290001Sglebius#define ISC_INT64_MAX	_I64_MAX
54290001Sglebius#define ISC_UINT64_MAX	_UI64_MAX
55290001Sglebius
56290001Sglebius#endif /* ISC_INT_H */
57