libpqxx 4.0
|
00001 /*------------------------------------------------------------------------- 00002 * 00003 * FILE 00004 * pqxx/compiler-internal.hxx 00005 * 00006 * DESCRIPTION 00007 * Compiler deficiency workarounds for compiling libpqxx itself. 00008 * DO NOT INCLUDE THIS FILE when building client programs. 00009 * 00010 * Copyright (c) 2002-2011, Jeroen T. Vermeulen <jtv@xs4all.nl> 00011 * 00012 * See COPYING for copyright license. If you did not receive a file called 00013 * COPYING with this source code, please notify the distributor of this mistake, 00014 * or contact the author. 00015 * 00016 *------------------------------------------------------------------------- 00017 */ 00018 #ifndef PQXX_H_COMPILER_INTERNAL 00019 #define PQXX_H_COMPILER_INTERNAL 00020 00021 00022 // Workarounds & definitions needed to compile libpqxx into a library 00023 #include "pqxx/config-internal-compiler.h" 00024 00025 // Library-private configuration related to libpq version 00026 #include "pqxx/config-internal-libpq.h" 00027 00028 #ifdef _WIN32 00029 00030 #ifdef PQXX_SHARED 00031 #undef PQXX_LIBEXPORT 00032 #define PQXX_LIBEXPORT __declspec(dllexport) 00033 // TODO: Does Windows have a way to "unexport" a symbol in an exported class? 00034 #define PQXX_PRIVATE __declspec() 00035 #endif // PQXX_SHARED 00036 00037 #ifdef _MSC_VER 00038 #pragma warning (disable: 4251 4275 4273) 00039 #pragma warning (disable: 4258) // Complains that for-scope usage is correct. 00040 #pragma warning (disable: 4290) 00041 #pragma warning (disable: 4351) 00042 #pragma warning (disable: 4355) 00043 #pragma warning (disable: 4786) 00044 #pragma warning (disable: 4800) // Performance warning for boolean conversions. 00045 #pragma warning (disable: 4996) // Complains that strncpy() "may" be unsafe. 00046 #endif 00047 00048 #elif defined(__GNUC__) && defined(PQXX_HAVE_GCC_VISIBILITY) // !_WIN32 00049 00050 #define PQXX_LIBEXPORT __attribute__ ((visibility("default"))) 00051 #define PQXX_PRIVATE __attribute__ ((visibility("hidden"))) 00052 00053 #endif // __GNUC__ && PQXX_HAVE_GCC_VISIBILITY 00054 00055 00056 #include "pqxx/compiler-public.hxx" 00057 00058 #include <cstddef> 00059 00060 #ifdef PQXX_HAVE_LIMITS 00061 #include <limits> 00062 #else // PQXX_HAVE_LIMITS 00063 #include <climits> 00064 namespace PGSTD 00065 { 00067 template<typename T> struct numeric_limits 00068 { 00069 static T max() throw (); 00070 static T min() throw (); 00071 }; 00072 template<> inline long numeric_limits<long>::max() throw () {return LONG_MAX;} 00073 template<> inline long numeric_limits<long>::min() throw () {return LONG_MIN;} 00074 } 00075 #endif // PQXX_HAVE_LIMITS 00076 #endif