1 | /*! |
---|
2 | * \file |
---|
3 | * \brief IT++ types definitions |
---|
4 | * \author Adam Piatyszek |
---|
5 | * |
---|
6 | * ------------------------------------------------------------------------- |
---|
7 | * |
---|
8 | * IT++ - C++ library of mathematical, signal processing, speech processing, |
---|
9 | * and communications classes and functions |
---|
10 | * |
---|
11 | * Copyright (C) 1995-2007 (see AUTHORS file for a list of contributors) |
---|
12 | * |
---|
13 | * This program is free software; you can redistribute it and/or modify |
---|
14 | * it under the terms of the GNU General Public License as published by |
---|
15 | * the Free Software Foundation; either version 2 of the License, or |
---|
16 | * (at your option) any later version. |
---|
17 | * |
---|
18 | * This program is distributed in the hope that it will be useful, |
---|
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | * GNU General Public License for more details. |
---|
22 | * |
---|
23 | * You should have received a copy of the GNU General Public License |
---|
24 | * along with this program; if not, write to the Free Software |
---|
25 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
26 | * |
---|
27 | * ------------------------------------------------------------------------- |
---|
28 | */ |
---|
29 | |
---|
30 | #ifndef ITTYPES_H |
---|
31 | #define ITTYPES_H |
---|
32 | |
---|
33 | #ifndef _MSC_VER |
---|
34 | # include <itpp/config.h> |
---|
35 | #else |
---|
36 | # include <itpp/config_msvc.h> |
---|
37 | #endif |
---|
38 | |
---|
39 | #ifndef NO_INT_SIZE_CHECK |
---|
40 | #if (SIZEOF_SHORT != 2) || (SIZEOF_UNSIGNED_SHORT != 2) \ |
---|
41 | || (SIZEOF_INT != 4) || (SIZEOF_UNSIGNED_INT != 4) |
---|
42 | # error \ |
---|
43 | This platform uses different sizes for "short" and "int" standard \ |
---|
44 | types than expected 2 and 4 bytes, respectively. This causes \ |
---|
45 | incompatibilities of some parts of IT++ with most of 32- and 64-bit \ |
---|
46 | platforms. Especially binary I/O operations will be incompatible. \ |
---|
47 | Please report this problem to IT++ developers. If you are OK with it \ |
---|
48 | you can add "-DNO_INT_SIZE_CHECK" to your CPPFLAGS and recompile the \ |
---|
49 | library. |
---|
50 | #endif |
---|
51 | #endif // ifndef NO_INT_SIZE_CHECK |
---|
52 | |
---|
53 | #if defined(HAVE_STDINT_H) |
---|
54 | # include <stdint.h> |
---|
55 | #elif defined(HAVE_INTTYPES_H) |
---|
56 | # include <inttypes.h> |
---|
57 | #else |
---|
58 | |
---|
59 | // Common typedefs for most 32- and 64-bit architechures |
---|
60 | typedef signed char int8_t; //!< 8-bit signed integer |
---|
61 | typedef unsigned char uint8_t; //!< 8-bit unsigned integer |
---|
62 | typedef signed short int16_t; //!< 16-bit signed integer |
---|
63 | typedef unsigned short uint16_t; //!< 16-bit unsigned integer |
---|
64 | typedef signed int int32_t; //!< 32-bit signed integer |
---|
65 | typedef unsigned int uint32_t; //!< 32-bit unsigned integer |
---|
66 | |
---|
67 | #if defined(_MSC_VER) |
---|
68 | typedef __int64 int64_t; //!< 64-bit signed integer |
---|
69 | typedef unsigned __int64 uint64_t; //!< 64-bit unsigned integer |
---|
70 | #elif (SIZEOF_LONG == 8) && (SIZEOF_UNSIGNED_LONG == 8) |
---|
71 | typedef signed long int64_t; //!< 64-bit signed integer |
---|
72 | typedef unsigned long uint64_t; //!< 64-bit unsigned integer |
---|
73 | #elif (SIZEOF_LONG_LONG == 8) && (SIZEOF_UNSIGNED_LONG_LONG == 8) |
---|
74 | typedef signed long long int64_t; //!< 64-bit signed integer |
---|
75 | typedef unsigned long long uint64_t; //!< 64-bit unsigned integer |
---|
76 | #else |
---|
77 | # error \ |
---|
78 | 64-bit integer type not detected on this platform. \ |
---|
79 | Please report the problem to IT++ developers. |
---|
80 | #endif // defined(_MSC_VER) |
---|
81 | |
---|
82 | #endif // defined(HAVE_STDINT_H) |
---|
83 | |
---|
84 | #endif /* ITTYPES_H */ |
---|