Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

compiler.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/compiler.h
00005  *
00006  *   DESCRIPTION
00007  *      Compiler deficiency workarounds
00008  *
00009  * Copyright (c) 2002-2003, Jeroen T. Vermeulen <jtv@xs4all.nl>
00010  *
00011  * See COPYING for copyright license.  If you did not receive a file called
00012  * COPYING with this source code, please notify the distributor of this mistake,
00013  * or contact the author.
00014  *
00015  *-------------------------------------------------------------------------
00016  */
00017 #ifndef PQXX_COMPILER_H
00018 #define PQXX_COMPILER_H
00019 
00020 #include "pqxx/config.h"
00021 
00022 #ifdef BROKEN_ITERATOR
00023 namespace PGSTD
00024 {
00026 template<typename Cat, 
00027          typename T, 
00028          typename Dist, 
00029          typename Ptr=T*,
00030          typename Ref=T&> struct iterator
00031 {
00032   typedef Cat iterator_category;
00033   typedef T value_type;
00034   typedef Dist difference_type;
00035   typedef Ptr pointer;
00036   typedef Ref reference;
00037 };
00038 }
00039 #else
00040 #include <iterator>
00041 #endif // BROKEN_ITERATOR
00042 
00043 #ifndef HAVE_CHAR_TRAITS
00044 namespace PGSTD
00045 {
00047 template<typename CHAR> struct char_traits {};
00049 template<> struct char_traits<char>
00050 {
00051   typedef int int_type;
00052   typedef size_t pos_type;
00053   typedef ptrdiff_t off_type;
00054 
00055   static int_type eof() { return -1; }
00056 };
00057 }
00058 #endif
00059 
00060 
00061 #ifdef HAVE_LIMITS
00062 #include <limits>
00063 #else // HAVE_LIMITS
00064 #include <climits>
00065 namespace PGSTD
00066 {
00068 template<typename T> struct numeric_limits
00069 {
00070   static T max() throw ();
00071   static T min() throw ();
00072 };
00073 
00075 template<> inline long numeric_limits<long>::max() throw () {return LONG_MAX;}
00077 template<> inline long numeric_limits<long>::min() throw () {return LONG_MIN;}
00078 }
00079 #endif // HAVE_LIMITS
00080 
00081 
00082 #ifndef HAVE_ABS_LONG
00083 // For compilers that feel abs(long) is ambiguous
00084 long abs(long n) { return (n >= 0) ? n : -n; }
00085 #endif // HAVE_ABS_LONG
00086 
00087 // Used for Windows DLL
00088 #ifndef PQXX_LIBEXPORT
00089 #define PQXX_LIBEXPORT
00090 #endif
00091 
00092 #endif
00093 

Generated on Tue Jul 15 13:03:56 2003 for libpqxx by doxygen 1.3.2