This is my first submit on ASF JIRA.
Fix Qpid Proton-C build with MinGW on Fedora. Patches are provided:
Patch 1: http://cheeselee.fedorapeople.org/qpid-proton_trunk_MinGW_STDIO.diff
Description: %z format specifier is not provided by MSVCRT, use MinGW version of *printf to get it. Otherwise build failed with: "proton-c/src/codec/codec.c:1951:3: error: unknown conversion type character 'z' in format [-Werror=format]"
Patch 2: http://cheeselee.fedorapeople.org/qpid-proton_trunk_small_cases.diff
Description: Libraries and header files should be written in small cases, otherwise build failed in cross build environment of Unix-like platforms: "proton-c/src/windows/driver.c:44:22: fatal error: Ws2tcpip.h: No such file or directory"
Patch 3: http://cheeselee.fedorapeople.org/qpid-proton_trunk_pn_connector_t.diff
Description: Change pn_connector_t::fd to type of pn_socket_t. Otherwise, since on Windows platform, pn_socket_t (typedef of SOCKET) is unsigned, build failed with: "proton-c/src/windows/driver.c:785:11: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]"
Patch 4: http://cheeselee.fedorapeople.org/qpid-proton_trunk_unimplemented_functions.diff
Description: Commented unimplemented functions. Otherwise build failed with "proton-c/src/windows/driver.c:416:13: error: 'pn_connector_write' declared 'static' but never defined [-Werror=unused-function]"
Patch 5: http://cheeselee.fedorapeople.org/qpid-proton_trunk_wincompat-getopt.diff
1. ID is not used, build failed with "../wincompat/internal/getopt.c:43:20: error: 'ID' defined but not used [-Werror=unused-variable]"
2. Corrected getopt signiture, otherwise build failed with "proton-c/src/../wincompat/internal/getopt.c:97:5: note: expected 'char *' but argument is of type 'const char *'"
3. wincompat/getopt.h #include wincompat/internal/getopt.c directly, so #include wincompat/getopt.h in .c files instead of .h, otherwise build failed with multiple definitions.
Patch 6: http://cheeselee.fedorapeople.org/qpid-proton_trunk_WIN32_macro.diff
Description: WIN32 macro is not defined with -std=c99 but defined with -std=gnu99. Use _WIN32 macro in all places.
Built on Fedora and examples of recv and send are tested on Windows 7.