Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix Windows compilation in master #63
Windows connect() does not set errno, and EINPRORGESS is not defined.
The patch below fixes it.
I also have many more patches.
The first would be the creation of a win32 directory with a self-contained
--- stephane-libmodbus-2dca042/src/modbus-tcp.c 2012-05-28 17:00:22.000000000 +0200
I've received many mails, patches and seen forks for Visual Studio but none of them was really clean (patches as directory tarballs, forks with huge copy/paste of codes, etc) so I'll be happy if you could provide a clean solution to have Visual Studio support (DRY and thin).
Your EXPORT solution is acceptable (as extern in the past :)
For the generic errors (Unix/Windows), other libraries ZMQ (now Crossroads IO), Cairo have nice solutions to do that.
Then in CustomWSAGetLastError you should set errno to EINPROGRESS (not defined under Win32) to what value ?
How should I submit the patch for win32 DLL ?
I think at something like https://github.com/crossroads-io/libxs/blob/master/src/err.cpp#L209
A fork, but please, create a dedicated branch to ease rebasing, try to create small and atomic patches (as you do until now :)
Today I have downloaded libmodbus 3.1.0 and installed mingw with C, C++ Compilers and Msys Basic System, MinGW developer kit.
I went to the root folder of the project, ran "sh" command -> "./configure" -> "./make install" and spent two hours and finally found this patch..
Fixed modbus-tcp.c file as mentioned..
I don't understand why you don't fix it on the main file and still serve a faulty file ???
I wish you guys best and thanks for the great work !!!!