ptypes.h

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 3 -*-
00002  *
00003  * Copyright (c), GREYC.
00004  * All rights reserved
00005  *
00006  * You may use this file under the terms of the BSD license as follows:
00007  *
00008  * "Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions are
00010  * met:
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above copyright
00014  *     notice, this list of conditions and the following disclaimer in
00015  *     the documentation and/or other materials provided with the
00016  *     distribution.
00017  *   * Neither the name of the GREYC, nor the name of its
00018  *     contributors may be used to endorse or promote products
00019  *     derived from this software without specific prior written
00020  *     permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00025  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00026  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00027  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00028  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00029  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00030  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00031  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
00033  *
00034  *
00035  * For more information, refer to:
00036  * https://clouard.users.greyc.fr/Pandore
00037  */
00038 
00044 #ifndef __PPTYPESH__
00045 #define __PPTYPESH__
00046 
00047 namespace pandore {
00048 
00049 #ifdef _MSC_VER
00050    typedef __int8       int8_t;
00051    typedef unsigned __int8      uint8_t;
00052    typedef __int16      int16_t;
00053    typedef unsigned __int16     uint16_t;
00054    typedef __int32      int32_t;
00055    typedef unsigned __int32     uint32_t;
00056    typedef __int64      int64_t;
00057    typedef unsigned __int64     uint64_t;
00058 #else
00059    #include <stdint.h>
00060 #endif
00061 
00062 /*
00063  * The basic scalar types.
00064  *
00065  * DO NOT DELETE the following inline comments (BASE and BASE IMAGE)!
00066  * (`BASE' is a flag for the preprocessor macro `forallbase')
00067  * (`BASE IMAGE' is a flag for the preprocessor macro `forallbaseimage')
00068  */
00069 typedef char            Char;   // BASE
00070 typedef unsigned char   Uchar;  // BASE IMAGE
00071 typedef int16_t         Short;  // BASE
00072 typedef uint16_t        Ushort; // BASE
00073 typedef int32_t         Long;   // BASE IMAGE
00074 typedef uint32_t        Ulong;  // BASE
00075 typedef int64_t         Llong;  // BASE
00076 typedef uint64_t        Ullong; // BASE
00077 typedef float           Float;  // BASE IMAGE
00078 typedef double          Double; // BASE
00079 
00080 #define POINTERSIZE     4
00081 
00082 #ifndef FLT_EPSILON
00083 #define FLT_EPSILON     1.1920928955078125000000E-07F
00084 #endif
00085 #ifndef DBL_EPSILON
00086 #define DBL_EPSILON     2.2204460492503130808473E-16
00087 #endif
00088 
00089 /*
00090  * Definition of max and min values for each types.
00091  */
00092 
00093 #ifndef MININT1
00094 #define MININT1 (-128)          /* min value of a "int 1 byte" */
00095 #endif
00096 
00097 #ifndef MAXINT1
00098 #define MAXINT1 127             /* max value of a "int 1 byte" */
00099 #endif
00100 
00101 #ifndef MAXUINT1
00102 #define MAXUINT1 255            /* max value of an "unsigned int 1 byte" */
00103 #endif
00104 
00105 #ifndef MININT2
00106 #define MININT2 (-32768)        /* min value of a "int 2 bytes" */
00107 #endif
00108 
00109 #ifndef MAXINT2
00110 #define MAXINT2 32767           /* max value of a "int 2 bytes" */
00111 #endif
00112 
00113 #ifndef MAXUINT2
00114 #define MAXUINT2 65535          /* max value of "unsigned int 2 bytes" */
00115 #endif
00116 
00117 #ifndef MININT4
00118 #define MININT4 (-2147483647-1) /* min value of an "int 4 bytes" */
00119 #endif
00120 
00121 #ifndef MAXINT4
00122 #define MAXINT4 2147483647      /* max value of an "int 4 bytes" */
00123 #endif
00124 
00125 #ifndef MAXUINT4
00126 #define MAXUINT4 4294967295U    /* max value of an "unsigned int 4 bytes" */
00127 #endif
00128 
00129 #ifndef MINFLOAT4
00130 #define MINFLOAT4 1.175494351E-38F /* max precision between 2 floats */
00131 #endif
00132 
00133 #ifndef MAXFLOAT4
00134 #define MAXFLOAT4 3.402823466E+38F
00135 #endif
00136 
00137 #ifndef MINFLOAT8
00138 #define MINFLOAT8 2.2250738585072014E-308 /* max precision between 2 floats */
00139 #endif
00140 
00141 #ifndef MAXFLOAT8
00142 #define MAXFLOAT8 1.7976931348623157E+308
00143 #endif
00144 
00145 // Kept for compatibility
00146 #ifndef MINCHAR
00147 #define MINCHAR (-128)          /* min value of a "signed char" */
00148 #endif
00149 
00150 #ifndef MAXCHAR
00151 #define MAXCHAR 127             /* max value of a "signed char" */
00152 #endif
00153 
00154 #ifndef MAXUCHAR
00155 #define MAXUCHAR 255            /* max value of an "unsigned char" */
00156 #endif
00157 
00158 
00159 #ifndef MINSHORT
00160 #define MINSHORT (-32768)       /* min value of a "short int" */
00161 #endif
00162 
00163 #ifndef MAXSHORT
00164 #define MAXSHORT 32767          /* max value of a "short int" */
00165 #endif
00166 
00167 #ifndef MAXUSHORT
00168 #define MAXUSHORT 65535         /* max value of "unsigned short int" */
00169 #endif
00170 
00171 
00172 #ifndef MINLONG
00173 #define MINLONG (-2147483647-1) /* min value of an "int 4 bytes" */
00174 #endif
00175 
00176 #ifndef MAXLONG
00177 #define MAXLONG 2147483647      /* max value of an "int 4 bytes" */
00178 #endif
00179 
00180 #ifndef MAXULONG
00181 #define MAXULONG 4294967295U    /* max value of an "unsigned long int" */
00182 #endif
00183 
00184 #ifndef MINFLOAT
00185 #define MINFLOAT 1.175494351E-38F
00186 #endif
00187 #ifndef MAXFLOAT
00188 #define MAXFLOAT 3.402823466E+38F
00189 #endif
00190 #ifndef MINDOUBLE
00191 #define MINDOUBLE 2.2250738585072014E-308
00192 #endif
00193 
00194 #ifndef MAXDOUBLE
00195 #define MAXDOUBLE 1.7976931348623157E+308
00196 #endif
00197 
00198 #ifndef MAXLLONG
00199 #define MAXLLONG 9223372036854775807LL
00200 #endif
00201 
00202 #ifndef MAXULLONG
00203 #define MAXULLONG 18446744073709551615ULL
00204 #endif
00205 
00206 } //End of pandore:: namespace
00207 
00208 #endif

The Pantheon project
Image Team GREYC Laboratory
UMR CNRS 6072 - ENSICAEN - University of Caen, France
This page was last modified on 19 June 2015