compiler-internal-pre.hxx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /** Compiler deficiency workarounds for compiling libpqxx headers.
  2. *
  3. * To be called at the start of each libpqxx header, in order to push the
  4. * client program's settings and apply libpqxx's settings.
  5. *
  6. * Must be balanced by an include of -header-post.hxx at the end
  7. * of the header.
  8. *
  9. * Copyright (c) 2000-2019, Jeroen T. Vermeulen.
  10. *
  11. * See COPYING for copyright license. If you did not receive a file called
  12. * COPYING with this source code, please notify the distributor of this mistake,
  13. * or contact the author.
  14. */
  15. // NO GUARDS HERE! This code should be executed every time!
  16. #ifdef _WIN32
  17. #ifdef _MSC_VER
  18. // Save client program warning state, and set warning level 4.
  19. // Setting the warning level explicitly ensures that libpqxx
  20. // headers will work with this warning level as well.
  21. #pragma warning (push,4)
  22. #pragma warning (disable: 4251)
  23. #pragma warning (disable: 4273)
  24. #pragma warning (disable: 4275)
  25. #pragma warning (disable: 4355)
  26. #pragma warning (disable: 4511) // Copy constructor could not be generated.
  27. #pragma warning (disable: 4512) // Assignment operator could not be generated.
  28. #pragma warning (disable: 4996) // Deprecation warning, e.g. about strncpy().
  29. #endif // _MSC_VER
  30. #endif // _WIN32