compiler-internal.hxx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /** Compiler deficiency workarounds for compiling libpqxx itself.
  2. *
  3. * DO NOT INCLUDE THIS FILE when building client programs.
  4. *
  5. * Copyright (c) 2000-2019, Jeroen T. Vermeulen.
  6. *
  7. * See COPYING for copyright license. If you did not receive a file called
  8. * COPYING with this source code, please notify the distributor of this mistake,
  9. * or contact the author.
  10. */
  11. #ifndef PQXX_H_COMPILER_INTERNAL
  12. #define PQXX_H_COMPILER_INTERNAL
  13. // Workarounds & definitions needed to compile libpqxx into a library
  14. #include "pqxx/config-internal-compiler.h"
  15. #ifdef _WIN32
  16. #ifdef PQXX_SHARED
  17. #undef PQXX_LIBEXPORT
  18. #define PQXX_LIBEXPORT __declspec(dllexport)
  19. #define PQXX_PRIVATE __declspec()
  20. #endif // PQXX_SHARED
  21. #ifdef _MSC_VER
  22. #pragma warning (disable: 4251 4275 4273)
  23. #pragma warning (disable: 4355)
  24. #pragma warning (disable: 4996) // Deprecation warning, e.g. about strncpy().
  25. #endif
  26. #elif defined(__GNUC__) && defined(PQXX_HAVE_GCC_VISIBILITY) // !_WIN32
  27. #define PQXX_LIBEXPORT __attribute__ ((visibility("default")))
  28. #define PQXX_PRIVATE __attribute__ ((visibility("hidden")))
  29. #endif // __GNUC__ && PQXX_HAVE_GCC_VISIBILITY
  30. #include "pqxx/compiler-public.hxx"
  31. #endif