diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libmodbus/library-linkage.diff | |
Diffstat (limited to 'vcpkg/ports/libmodbus/library-linkage.diff')
| -rw-r--r-- | vcpkg/ports/libmodbus/library-linkage.diff | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vcpkg/ports/libmodbus/library-linkage.diff b/vcpkg/ports/libmodbus/library-linkage.diff new file mode 100644 index 0000000..402363d --- /dev/null +++ b/vcpkg/ports/libmodbus/library-linkage.diff @@ -0,0 +1,32 @@ +diff --git a/configure.ac b/configure.ac +index 9f30d29..29737da 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -120,6 +120,14 @@ AC_C_INLINE + # libtool + AC_PROG_CXX + ++if "$os_win32" = "true"; then ++ if test "$enable_shared" = "yes"; then ++ AC_DEFINE(DLLBUILD, [], [Building a DLL]) ++ else ++ AC_DEFINE(STATIC_LIBMODBUS, [], [Building a static library]) ++ fi ++fi ++ + # Various types + AC_TYPE_INT64_T + AC_TYPE_SIZE_T +diff --git a/src/modbus.h b/src/modbus.h +index fa7ec4a..ae204ce 100644 +--- a/src/modbus.h ++++ b/src/modbus.h +@@ -25,6 +25,8 @@ + # if defined(DLLBUILD) + /* define DLLBUILD when building the DLL */ + # define MODBUS_API __declspec(dllexport) ++# elif defined(STATIC_LIBMODBUS) ++# define MODBUS_API + # else + # define MODBUS_API __declspec(dllimport) + # endif |