openslide-features.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * OpenSlide, a library for reading whole slide image files
  3. *
  4. * Copyright (c) 2007-2012 Carnegie Mellon University
  5. * All rights reserved.
  6. *
  7. * OpenSlide is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation, version 2.1.
  10. *
  11. * OpenSlide is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with OpenSlide. If not, see
  18. * <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. #ifndef OPENSLIDE_OPENSLIDE_FEATURES_H_
  22. #define OPENSLIDE_OPENSLIDE_FEATURES_H_
  23. // for exporting from shared libraries or DLLs
  24. #if defined _WIN32
  25. # ifdef _OPENSLIDE_BUILDING_DLL
  26. # define OPENSLIDE_PUBLIC() __declspec(dllexport)
  27. # else
  28. # define OPENSLIDE_PUBLIC() __declspec(dllimport)
  29. # endif
  30. #elif defined OPENSLIDE_SIMPLIFY_HEADERS
  31. // avoid constructs that could confuse a simplistic header parser
  32. # define OPENSLIDE_PUBLIC()
  33. #elif __GNUC__ > 3
  34. # define OPENSLIDE_PUBLIC() __attribute__ ((visibility("default")))
  35. #else
  36. # define OPENSLIDE_PUBLIC()
  37. #endif
  38. // if possible, produce compiler warnings when deprecated functions
  39. // are used
  40. #if defined OPENSLIDE_SIMPLIFY_HEADERS
  41. # define OPENSLIDE_DEPRECATED()
  42. #elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
  43. # define OPENSLIDE_DEPRECATED() __attribute__((deprecated))
  44. #elif defined _MSC_VER
  45. # define OPENSLIDE_DEPRECATED() __declspec(deprecated)
  46. #else
  47. # define OPENSLIDE_DEPRECATED()
  48. #endif
  49. #if defined OPENSLIDE_SIMPLIFY_HEADERS
  50. # define OPENSLIDE_DEPRECATED_FOR(f)
  51. #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
  52. # define OPENSLIDE_DEPRECATED_FOR(f) \
  53. __attribute__((deprecated("Use " #f " instead")))
  54. #elif defined _MSC_VER
  55. # define OPENSLIDE_DEPRECATED_FOR(f) \
  56. __declspec(deprecated("deprecated: Use " #f " instead"))
  57. #else
  58. # define OPENSLIDE_DEPRECATED_FOR(f) OPENSLIDE_DEPRECATED()
  59. #endif
  60. #endif