libpqxx  5.0
compiler-internal.hxx
1 /*-------------------------------------------------------------------------
2  *
3  * FILE
4  * pqxx/compiler-internal.hxx
5  *
6  * DESCRIPTION
7  * Compiler deficiency workarounds for compiling libpqxx itself.
8  * DO NOT INCLUDE THIS FILE when building client programs.
9  *
10  * Copyright (c) 2002-2015, Jeroen T. Vermeulen <jtv@xs4all.nl>
11  *
12  * See COPYING for copyright license. If you did not receive a file called
13  * COPYING with this source code, please notify the distributor of this mistake,
14  * or contact the author.
15  *
16  *-------------------------------------------------------------------------
17  */
18 #ifndef PQXX_H_COMPILER_INTERNAL
19 #define PQXX_H_COMPILER_INTERNAL
20 
21 
22 // Workarounds & definitions needed to compile libpqxx into a library
23 #include "pqxx/config-internal-compiler.h"
24 
25 #ifdef _WIN32
26 
27 #ifdef PQXX_SHARED
28 #undef PQXX_LIBEXPORT
29 #define PQXX_LIBEXPORT __declspec(dllexport)
30 // TODO: Does Windows have a way to "unexport" a symbol in an exported class?
31 #define PQXX_PRIVATE __declspec()
32 #endif // PQXX_SHARED
33 
34 #ifdef _MSC_VER
35 #pragma warning (disable: 4251 4275 4273)
36 #pragma warning (disable: 4258) // Complains that for-scope usage is correct.
37 #pragma warning (disable: 4290)
38 #pragma warning (disable: 4351)
39 #pragma warning (disable: 4355)
40 #pragma warning (disable: 4786)
41 #pragma warning (disable: 4800) // Performance warning for boolean conversions.
42 #pragma warning (disable: 4996) // Complains that strncpy() "may" be unsafe.
43 #endif
44 
45 #elif defined(__GNUC__) && defined(PQXX_HAVE_GCC_VISIBILITY) // !_WIN32
46 
47 #define PQXX_LIBEXPORT __attribute__ ((visibility("default")))
48 #define PQXX_PRIVATE __attribute__ ((visibility("hidden")))
49 
50 #endif // __GNUC__ && PQXX_HAVE_GCC_VISIBILITY
51 
52 
53 #include "pqxx/compiler-public.hxx"
54 
55 #include <cstddef>
56 #include <limits>
57 
58 #endif