00001 00004 /* Copyright (C) 2009 Olly Betts 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License as 00008 * published by the Free Software Foundation; either version 2 of the 00009 * License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00019 * USA 00020 */ 00021 00022 #ifndef XAPIAN_INCLUDED_INTERNALTYPES_H 00023 #define XAPIAN_INCLUDED_INTERNALTYPES_H 00024 00026 typedef unsigned char byte; 00027 00028 #ifndef SIZEOF_INT 00029 # error SIZEOF_INT is not defined 00030 #endif 00031 #ifndef SIZEOF_LONG 00032 # error SIZEOF_LONG is not defined 00033 #endif 00034 #if SIZEOF_INT >= 4 00035 typedef unsigned int uint4; 00036 #elif SIZEOF_LONG >= 4 00037 typedef unsigned long uint4; 00038 #else 00039 # error Type long is less than 32 bits, which ISO does not allow! 00040 #endif 00041 00042 #if SIZEOF_LONG >= 8 00043 typedef unsigned long uint8; 00044 #else 00045 /* "long long" is C99, and will be in C++-1x, but isn't yet standard C++. 00046 * However it seems to be widely supported (e.g. GCC has supported it for ages, 00047 * MSVC since at least 2003 it appears) and we've not had any reports of 00048 * compilation failing due to lack of support for it. 00049 */ 00050 typedef unsigned long long uint8; 00051 #endif 00052 00054 typedef uint8 totlen_t; 00055 00056 #endif // XAPIAN_INCLUDED_INTERNALTYPES_H