GenApiCDefines.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*-----------------------------------------------------------------------------
  2. Basler pylon C SDK
  3. Copyright (c) 2012-2021 Basler AG
  4. http://www.baslerweb.com
  5. -----------------------------------------------------------------------------*/
  6. /**
  7. \file
  8. \brief Platform-dependent macro definitions.
  9. */
  10. #ifndef GenApiCDefines_h__
  11. #define GenApiCDefines_h__
  12. #if defined (_MSC_VER) || defined (__BORLANDC__) || defined (__MINGW32__)
  13. # define GENAPIC_WIN_BUILD /**< Will be set when building for windows platforms. */
  14. #elif (defined(__GNUC__) && (defined(__linux__)) || defined(__APPLE__))
  15. # define GENAPIC_LINUX_BUILD /**< Will be set when building for linux platforms. */
  16. #else
  17. # error Unsupported platform
  18. #endif
  19. #if defined (GENAPIC_WIN_BUILD)
  20. # if defined (GENAPIC_EXPORTS) && defined (__cplusplus)
  21. # define GENAPIC_API __declspec(dllexport)
  22. # else
  23. # define GENAPIC_API __declspec(dllimport)
  24. # endif
  25. # define GENAPIC_CC __stdcall
  26. # define GENAPIC_PACKING 8
  27. #elif defined (GENAPIC_LINUX_BUILD)
  28. # if defined (GENAPIC_EXPORTS) && defined (__cplusplus)
  29. # define GENAPIC_API __attribute__((visibility("default")))
  30. # else
  31. # define GENAPIC_API
  32. # endif
  33. # define GENAPIC_CC
  34. # define GENAPIC_PACKING 8
  35. #else
  36. # error Unsupported platform
  37. #endif
  38. #ifndef _HRESULT_DEFINED
  39. # define _HRESULT_DEFINED
  40. typedef long HRESULT;
  41. #endif /* !_HRESULT_DEFINED */
  42. #endif /* GenApiCDefines_h__ */