etisserant@1: /* etisserant@1: * (c) 2000 Jiri Baum etisserant@1: * Mario de Sousa etisserant@1: * etisserant@1: * Offered to the public under the terms of the GNU General Public License etisserant@1: * as published by the Free Software Foundation; either version 2 of the etisserant@1: * License, or (at your option) any later version. etisserant@1: * etisserant@1: * This program is distributed in the hope that it will be useful, but etisserant@1: * WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@1: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General etisserant@1: * Public License for more details. etisserant@1: * etisserant@1: * This code is made available on the understanding that it will not be etisserant@1: * used in safety-critical situations without a full and competent review. etisserant@1: */ etisserant@1: etisserant@1: etisserant@1: #ifndef __PLC_TYPES_H etisserant@1: #define __PLC_TYPES_H etisserant@1: etisserant@1: #include etisserant@1: #include /* some limits related to floats are located here (?) */ etisserant@1: etisserant@1: etisserant@1: /* etisserant@1: * This will need to be conditional on the arquitecture or something. etisserant@1: * Anyone know where we can snarf the relevant magic easily? etisserant@1: */ etisserant@1: typedef double f64; /* 64-bit floating point */ etisserant@1: typedef float f32; /* 32-bit floating point */ etisserant@1: etisserant@1: typedef unsigned long long int u64; /* 64-bit unsigned integer */ etisserant@1: typedef long long int i64; /* 64-bit signed integer */ etisserant@1: typedef unsigned int u32; /* 32-bit unsigned integer */ etisserant@1: typedef int i32; /* 32-bit signed integer */ etisserant@1: typedef unsigned short int u16; /* 16-bit unsigned integer */ etisserant@1: typedef short int i16; /* 16-bit signed integer */ etisserant@1: typedef unsigned char u8; /* 8-bit unsigned integer */ etisserant@1: typedef signed char i8; /* 8-bit signed integer */ etisserant@1: etisserant@1: /* some platforms seem to be missing with the definition of FLT_MAX */ etisserant@1: #ifndef FLT_MAX etisserant@1: /* this is the minimum value guaranteed by ANSI C++ */ etisserant@1: /* does anybody know the minimum value guaranteed for ANSI C ? */ etisserant@1: #define FLT_MAX 1E+37 etisserant@1: #endif etisserant@1: #ifndef FLT_MIN etisserant@1: /* this is the minimum value guaranteed by ANSI C++ */ etisserant@1: /* does anybody know the minimum value guaranteed for ANSI C ? */ etisserant@1: #define FLT_MIN 1E-37 etisserant@1: #endif etisserant@1: etisserant@1: #define f32_MAX FLT_MAX etisserant@1: #define f32_MIN FLT_MIN etisserant@1: etisserant@1: #define u32_MAX UINT_MAX etisserant@1: #define u32_MIN 0 etisserant@1: #define i32_MAX INT_MAX etisserant@1: #define i32_MIN INT_MIN etisserant@1: etisserant@1: #define u16_MAX USHRT_MAX etisserant@1: #define u16_MIN 0 etisserant@1: #define i16_MAX SHRT_MAX etisserant@1: #define i16_MIN SHRT_MIN etisserant@1: etisserant@1: #define u8_MAX UCHAR_MAX etisserant@1: #define u8_MIN 0 etisserant@1: #define i8_MAX SCHAR_MAX etisserant@1: #define i8_MIN SCHAR_MIN etisserant@1: etisserant@1: #endif /* __PLC_TYPES_H */ etisserant@1: