Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

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, Jeroen T. Vermeulen <jtv@xs4all.nl>
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 #ifndef PQXX_COMPILER_H
00014 #define PQXX_COMPILER_H
00015 
00016 #include "pqxx/config.h"
00017 
00018 #ifdef BROKEN_ITERATOR
00019 namespace PGSTD
00020 {
00022 template<typename Cat, 
00023          typename T, 
00024          typename Dist, 
00025          typename Ptr=T*,
00026          typename Ref=T&> struct iterator
00027 {
00028   typedef Cat iterator_category;
00029   typedef T value_type;
00030   typedef Dist difference_type;
00031   typedef Ptr pointer;
00032   typedef Ref reference;
00033 };
00034 }
00035 #else
00036 #include <iterator>
00037 #endif // BROKEN_ITERATOR
00038 
00039 
00040 #ifdef HAVE_LIMITS
00041 #include <limits>
00042 #else // HAVE_LIMITS
00043 #include <climits>
00044 namespace PGSTD
00045 {
00047 template<typename T> struct numeric_limits
00048 {
00049   static T max() throw ();
00050   static T min() throw ();
00051 };
00052 
00053 template<> inline long numeric_limits<long>::max() throw () {return LONG_MAX;}
00054 template<> inline long numeric_limits<long>::min() throw () {return LONG_MIN;}
00055 }
00056 #endif // HAVE_LIMITS
00057 
00058 
00059 // Used for Windows DLL
00060 #define PQXX_LIBEXPORT
00061 
00062 
00063 #ifdef _MSC_VER
00064 // Microsoft Visual C++ likes to complain about long debug symbols, which
00065 // are a fact of life in modern C++.  Silence the warning.
00066 #pragma warning (disable: 4786)
00067 
00068 // Compiler doesn't know if it is import or export
00069 #pragma warning (disable: 4251 4275)
00070 
00071 // Link to libpq
00072 #pragma comment(lib, "libpqdll")
00073 
00074 #undef PQXX_LIBEXPORT
00075 #ifndef LIBPQXXDLL_EXPORTS      // Defined in Makefile
00076 #define PQXX_LIBEXPORT __declspec(dllimport)
00077 #else
00078 #define PQXX_LIBEXPORT __declspec(dllexport)
00079 #endif  // LIBPQXXDLL_EXPORTS
00080 
00081 #endif  // _MSC_VER
00082 
00083 
00084 #endif
00085 

Generated on Sat Aug 10 21:52:37 2002 for libpqxx by doxygen1.2.16