From 8aefad41ab5fef3bbe743b3c1748581760b99a35 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 30 Dec 2023 19:23:56 +0100 Subject: [PATCH] Allow compiling the Syncthing library interface with MSVC I haven't tested linking and execution yet; it would probably require to use e.g. `mingw-w64-ucrt-x86_64-go` from MSYS2 (instead of `mingw-w64-x86_64-go` where the stdlib clashes). --- syncthing/interface.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syncthing/interface.cpp b/syncthing/interface.cpp index bf3aa63..e765dec 100644 --- a/syncthing/interface.cpp +++ b/syncthing/interface.cpp @@ -10,6 +10,11 @@ #define __declspec(foo) #endif +// enforce use of the C header for complex types as cgo's typedefs rely on it +#ifdef _MSC_VER +#define _CRT_USE_C_COMPLEX_H +#endif + #include "libsyncthinginternal.h" #include