visibility.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Summary: interface for HashKit functions
  3. * Description: visibitliy macros for HashKit library
  4. *
  5. * Use and distribution licensed under the BSD license. See
  6. * the COPYING file in this directory for full text.
  7. *
  8. * Author: Monty Taylor
  9. */
  10. /**
  11. * @file
  12. * @brief Visibility control macros
  13. */
  14. #pragma once
  15. /**
  16. *
  17. * HASHKIT_API is used for the public API symbols. It either DLL imports or
  18. * DLL exports (or does nothing for static build).
  19. *
  20. * HASHKIT_LOCAL is used for non-api symbols.
  21. */
  22. #if defined(BUILDING_HASHKIT)
  23. # if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
  24. # define HASHKIT_API __attribute__ ((visibility("default")))
  25. # define HASHKIT_LOCAL __attribute__ ((visibility("hidden")))
  26. # elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
  27. # define HASHKIT_API __global
  28. # define HASHKIT_LOCAL __hidden
  29. # elif defined(_MSC_VER)
  30. # define HASHKIT_API extern __declspec(dllexport)
  31. # define HASHKIT_LOCAL
  32. # else
  33. # define HASHKIT_API
  34. # define HASHKIT_LOCAL
  35. # endif /* defined(HAVE_VISIBILITY) */
  36. #else /* defined(BUILDING_HASHKIT) */
  37. # if defined(_MSC_VER)
  38. # define HASHKIT_API extern __declspec(dllimport)
  39. # define HASHKIT_LOCAL
  40. # else
  41. # define HASHKIT_API
  42. # define HASHKIT_LOCAL
  43. # endif /* defined(_MSC_VER) */
  44. #endif /* defined(BUILDING_HASHKIT) */