HDeclSpec.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. /* HALCON library. If _HLibStatic is defined, HALCON is a static library. */
  15. #if defined(_HLibStatic)
  16. # define HLibExport
  17. #elif defined(_WIN32) && !defined(_NODLL)
  18. # if defined(_HLibDLL)
  19. # define HLibExport __declspec(dllexport)
  20. # else
  21. # define HLibExport __declspec(dllimport)
  22. # endif
  23. #elif defined(__GNUC__) && (__GNUC__ >= 4)
  24. # define HLibExport __attribute__((visibility("default")))
  25. #else
  26. # define HLibExport
  27. #endif
  28. /*
  29. * HALCON language interfaces. If _LIntExport is defined, the language
  30. * interfaces are static libraries.
  31. */
  32. #if defined(_LIntStatic)
  33. # define LIntExport
  34. #elif defined(_WIN32) && !defined(_NODLL)
  35. # if defined(_LIntDLL)
  36. # define LIntExport __declspec(dllexport)
  37. # else
  38. # define LIntExport __declspec(dllimport)
  39. # endif
  40. #elif defined(__GNUC__) && (__GNUC__ >= 4)
  41. # define LIntExport __attribute__((visibility("default")))
  42. #else
  43. # define LIntExport
  44. #endif
  45. /* Extension packages. These are always shared libraries / DLLs */
  46. #if defined(_WIN32)
  47. # define HUserExport __declspec(dllexport)
  48. # define HUserImport __declspec(dllimport)
  49. #elif defined(__GNUC__) && (__GNUC__ >= 4)
  50. # define HUserExport __attribute__((visibility("default")))
  51. # define HUserImport
  52. #else
  53. # define HUserExport
  54. # define HUserImport
  55. #endif
  56. #endif