beforestd.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/beforestd.h
  3. // Purpose: #include before STL headers
  4. // Author: Vadim Zeitlin
  5. // Modified by:
  6. // Created: 07/07/03
  7. // Copyright: (c) 2003 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. /**
  11. Unfortunately, when compiling at maximum warning level, the standard
  12. headers themselves may generate warnings -- and really lots of them. So
  13. before including them, this header should be included to temporarily
  14. suppress the warnings and after this the header afterstd.h should be
  15. included to enable them back again.
  16. Note that there are intentionally no inclusion guards in this file, because
  17. it can be included several times.
  18. */
  19. // VC 7.x isn't as bad as VC6 and doesn't give these warnings but eVC (which
  20. // defines _MSC_VER as 1201) does need to be included as it's VC6-like
  21. #if defined(__VISUALC__) && __VISUALC__ <= 1201
  22. // these warning have to be disabled and not just temporarily disabled
  23. // because they will be given at the end of the compilation of the
  24. // current source and there is absolutely nothing we can do about them so
  25. // disable them before warning(push) below
  26. // 'foo': unreferenced inline function has been removed
  27. #pragma warning(disable:4514)
  28. // 'function' : function not inlined
  29. #pragma warning(disable:4710)
  30. // 'id': identifier was truncated to 'num' characters in the debug info
  31. #pragma warning(disable:4786)
  32. // MSVC 5 does not have this
  33. #if __VISUALC__ > 1100
  34. // we have to disable (and reenable in afterstd.h) this one because,
  35. // even though it is of level 4, it is not disabled by warning(push, 1)
  36. // below for VC7.1!
  37. // unreachable code
  38. #pragma warning(disable:4702)
  39. #pragma warning(push, 1)
  40. #else // VC 5
  41. // 'expression' : signed/unsigned mismatch
  42. #pragma warning(disable:4018)
  43. // 'identifier' : unreferenced formal parameter
  44. #pragma warning(disable:4100)
  45. // 'conversion' : conversion from 'type1' to 'type2',
  46. // possible loss of data
  47. #pragma warning(disable:4244)
  48. // C++ language change: to explicitly specialize class template
  49. // 'identifier' use the following syntax
  50. #pragma warning(disable:4663)
  51. #endif
  52. #endif // VC++ < 7
  53. /**
  54. GCC's visibility support is broken for libstdc++ in some older versions
  55. (namely Debian/Ubuntu's GCC 4.1, see
  56. https://bugs.launchpad.net/ubuntu/+source/gcc-4.1/+bug/109262). We fix it
  57. here by mimicking newer versions' behaviour of using default visibility
  58. for libstdc++ code.
  59. */
  60. #if defined(HAVE_VISIBILITY) && defined(HAVE_BROKEN_LIBSTDCXX_VISIBILITY)
  61. #pragma GCC visibility push(default)
  62. #endif