mirror of
git://sigrok.org/libserialport
synced 2023-08-10 21:13:24 +03:00
For MSVC, we need to set the __declspec() for public symbols to dllexport or dllimport, depending if we are building or using the library. So, detect MSVC and define SP_API appropriately if found. We use the LIBSERIALPORT_MSBUILD define to distinguish between building and using the library, which will need to be set in the project configuration when building the library using MS tools. For normal client use of the header on other systems, we need to define SP_API to nothing to avoid it being undefined, but we need to avoid doing this in the case where we are including the header whilst building the library with autotools and SP_API is already set by autoconf. So define LIBSERIALPORT_ATBUILD in AM_CFLAGS, and don't touch SP_API in the header if that's set.
108 KiB
108 KiB