libpqxx  7.0.1
pqxx-source.hxx
1 /* Compiler settings for compiling libpqxx itself.
2  *
3  * Include this header in every source file that goes into the libpqxx library
4  * binary, and nowhere else.
5  *
6  * To ensure this, include this file once, as the very first header, in each
7  * compilation unit for the library.
8  *
9  * DO NOT INCLUDE THIS FILE when building client programs.
10  *
11  * Copyright (c) 2000-2020, Jeroen T. Vermeulen.
12  *
13  * See COPYING for copyright license. If you did not receive a file called
14  * COPYING with this source code, please notify the distributor of this
15  * mistake, or contact the author.
16  */
17 #ifndef PQXX_H_COMPILER_INTERNAL
18 #define PQXX_H_COMPILER_INTERNAL
19 
20 
21 // Workarounds & definitions needed to compile libpqxx into a library
22 #include "pqxx/config-internal-compiler.h"
23 
24 // TODO: Check for Visual Studio, not for Windows.
25 #ifdef _WIN32
26 
27 # ifdef PQXX_SHARED
28 // We're building libpqxx as a shared library.
29 # undef PQXX_LIBEXPORT
30 # define PQXX_LIBEXPORT __declspec(dllexport)
31 # define PQXX_PRIVATE __declspec()
32 # endif // PQXX_SHARED
33 
34 #elif defined(__GNUC__) && defined(PQXX_HAVE_GCC_VISIBILITY) // !_WIN32
35 
36 # define PQXX_LIBEXPORT __attribute__((visibility("default")))
37 # define PQXX_PRIVATE __attribute__((visibility("hidden")))
38 
39 #endif // __GNUC__ && PQXX_HAVE_GCC_VISIBILITY
40 
41 #include "pqxx/compiler-public.hxx"
42 #endif