# integers.hpp

Go to the documentation of this file.

    00001 /*********************************************************************/
    00002 // dar - disk archive - a backup/restoration program
    00003 // Copyright (C) 2002-2052 Denis Corbin
    00004 //
    00005 // This program is free software; you can redistribute it and/or
    00006 // modify it under the terms of the GNU General Public License
    00007 // as published by the Free Software Foundation; either version 2
    00008 // of the License, or (at your option) any later version.
    00009 //
    00010 // This program is distributed in the hope that it will be useful,
    00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00013 // GNU General Public License for more details.
    00014 //
    00015 // You should have received a copy of the GNU General Public License
    00016 // along with this program; if not, write to the Free Software
    00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    00018 //
    00019 // to contact the author : dar.linux@free.fr
    00020 /*********************************************************************/
    00021 // $Id: integers.hpp,v 1.11 2004/11/07 18:21:38 edrusb Rel $
    00022 //
    00023 /*********************************************************************/
    00024
    00025
    00028
    00029
    00030 #ifndef INTEGERS_HPP
    00031 #define INTEGERS_HPP
    00032
    00033 #include "../my_config.h"
    00034
    00035 #ifndef OS_BITS
    00036
    00037 #if HAVE_INTTYPES_H
    00038 extern "C"
    00039 {
    00040 #include <inttypes.h>
    00041 } // end extern "C"
    00042
    00043 namespace libdar
    00044 {
    00045
    00046     typedef unsigned char U_8;
    00047     typedef uint16_t U_16;
    00048     typedef uint32_t U_32;
    00049     typedef uint64_t U_64;
    00050     typedef unsigned int U_I;
    00051     typedef signed char S_8;
    00052     typedef int16_t S_16;
    00053     typedef int32_t S_32;
    00054     typedef int64_t S_64;
    00055     typedef signed int S_I;
    00056
    00057 }
    00058
    00059 #else // HAVE_INTTYPES_H
    00060 #error "Cannot determine interger types, use --enable-os-bits=... with the 'configure' script according to your system's CPU register size"
    00061 #endif // HAVE_INTTYPES_H
    00062
    00063 #else  //  OS_BITS not defined
    00064 #if OS_BITS == 32
    00065
    00066 namespace libdar
    00067 {
    00068     typedef unsigned char U_8;
    00069     typedef unsigned short U_16;
    00070     typedef unsigned long U_32;
    00071     typedef unsigned long long U_64;
    00072     typedef unsigned int U_I;
    00073     typedef signed char S_8;
    00074     typedef signed short S_16;
    00075     typedef signed long S_32;
    00076     typedef signed long long S_64;
    00077     typedef signed int S_I;
    00078
    00079 }
    00080
    00081 #else
    00082 #if OS_BITS == 64
    00083
    00084 namespace libdar
    00085 {
    00086     typedef unsigned char U_8;
    00087     typedef unsigned short U_16;
    00088     typedef unsigned int U_32;
    00089     typedef unsigned long long U_64;
    00090     typedef unsigned int U_I;
    00091     typedef signed char S_8;
    00092     typedef signed short S_16;
    00093     typedef signed int S_32;
    00094     typedef signed long long S_64;
    00095     typedef signed int S_I;
    00096
    00097 }
    00098
    00099 #else
    00100 #error "unknown value given to --enable-os-bits=... check the 'configure' script arguments"
    00101     // unknown OS_BITS value ! use --enable-os-bits=... option to configure script
    00102     //
    00103     // the previous line should not compile, this is the expected behaviour
    00104
    00105 #endif // OS_BITS == 64
    00106 #endif // OS_BITS == 32
    00107 #endif // OS_BITS not defined
    00108
    00109 #endif // header file multiple inclusion protection