HDeclSpec.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*****************************************************************************
  2. * HDeclSpec.h
  3. *****************************************************************************
  4. *
  5. * Project: HALCON/libhalcon
  6. * Description: Windows DLL specifications
  7. *
  8. * (c) 1996-2020 by MVTec Software GmbH
  9. * www.mvtec.com
  10. *
  11. *****************************************************************************/
  12. #ifndef HALCON_DECL_SPEC_H
  13. #define HALCON_DECL_SPEC_H
  14. #if defined(_WIN32) && !defined (_NODLL)
  15. /* HALCON Library: */
  16. # if defined(_HLibDLL)
  17. # define HLibExport __declspec(dllexport)
  18. # elif !defined(_HLibStatic)
  19. # define HLibExport __declspec(dllimport)
  20. # else
  21. # define HLibExport
  22. # endif
  23. /* Language Interfaces: */
  24. # if defined(_LIntDLL)
  25. # define LIntExport __declspec(dllexport)
  26. # elif !defined(_LIntStatic)
  27. # define LIntExport __declspec(dllimport)
  28. # else
  29. # define LIntExport
  30. # endif
  31. /* Extension Packages: */
  32. # define HUserExport __declspec(dllexport)
  33. # define HUserImport __declspec(dllimport)
  34. #else
  35. # if defined(__GNUC__) && (__GNUC__ >= 4)
  36. # define HLibExport __attribute__ ((visibility("default")))
  37. # define LIntExport __attribute__ ((visibility("default")))
  38. # define HUserExport __attribute__ ((visibility("default")))
  39. # elif defined(__sun) && (defined(__SUNPRO_C) || defined(__SUNPRO_CC))
  40. # define HLibExport __global
  41. # define LIntExport __global
  42. # define HUserExport __global
  43. # else /* Any other Unix */
  44. # define HLibExport
  45. # define LIntExport
  46. # define HUserExport
  47. # endif /* Any other Unix */
  48. # define HUserImport
  49. #endif /* not _WIN32 */
  50. #endif