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

libcompiler.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/libcompiler.h
00005  *
00006  *   DESCRIPTION
00007  *      Compiler deficiency workarounds for libpqxx clients
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_LIBCOMPILER_H
00018 #define PQXX_LIBCOMPILER_H
00019 
00020 // Workarounds & definitions that need to be included even in library's headers
00021 #include "pqxx/libconfig.h"
00022 
00023 #ifdef PQXX_BROKEN_ITERATOR
00024 namespace PGSTD
00025 {
00027 template<typename Cat, 
00028          typename T, 
00029          typename Dist, 
00030          typename Ptr=T*,
00031          typename Ref=T&> struct iterator
00032 {
00033   typedef Cat iterator_category;
00034   typedef T value_type;
00035   typedef Dist difference_type;
00036   typedef Ptr pointer;
00037   typedef Ref reference;
00038 };
00039 }
00040 #else
00041 #include <iterator>
00042 #endif // PQXX_BROKEN_ITERATOR
00043 
00044 #ifndef HAVE_CHAR_TRAITS
00045 namespace PGSTD
00046 {
00048 template<typename CHAR> struct char_traits {};
00050 template<> struct char_traits<char>
00051 {
00052   typedef int int_type;
00053   typedef size_t pos_type;
00054   typedef ptrdiff_t off_type;
00055 
00056   static int_type eof() { return -1; }
00057 };
00058 }
00059 #endif
00060 
00061 // Workarounds for Windows
00062 #ifdef _WIN32
00063 
00064 #ifdef _MSC_VER
00065 #if _MSC_VER < 1300
00066 #error If you're using Visual C++, you'll need at least version 7 (VC.NET)
00067 #endif  // _MSC_VER < 1300
00068 
00069 // Workarounds for Visual C++.NET (2003 version does seem to work)
00070 #if _MSC_VER < 1310
00071 #define PQXX_WORKAROUND_VC7
00072 #define PQXX_NO_PARTIAL_CLASS_TEMPLATE_SPECIALISATION
00073 #define PQXX_TYPENAME
00074 #endif  // _MSC_VER < 1310
00075 #pragma warning (disable: 4290)
00076 #pragma warning (disable: 4786)
00077 #pragma warning (disable: 4251 4275 4273)
00078 #pragma comment(lib, "libpqdll")
00079 #if !defined(PQXX_LIBEXPORT) && !defined(_LIB)
00080 #define PQXX_LIBEXPORT __declspec(dllimport)
00081 #endif  // PQXX_LIBEXPORT _LIB
00082 #endif  // _MSC_VER
00083 #endif  // _WIN32
00084 
00085 // Used for Windows DLL
00086 #ifndef PQXX_LIBEXPORT
00087 #define PQXX_LIBEXPORT
00088 #endif
00089 
00090 // Some compilers (well, VC) stumble over some required cases of "typename"
00091 #ifndef PQXX_TYPENAME
00092 #define PQXX_TYPENAME typename
00093 #endif
00094 
00095 #endif
00096 

Generated on Fri Nov 14 19:37:18 2003 for libpqxx by doxygen 1.3.4