You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2020/07/10 13:58:00 UTC

[qpid-proton] branch master updated (2cd9522 -> 4ffea3a)

This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git.


    from 2cd9522  PROTON-2235 set threaderciser test timeout and modernize compilation (#262)
     new 5ecfd8c  PROTON-2077: Update documentation for changed Windows minimum requirements
     new e3d8547  PROTON-2077: The win_iocp code is really C++ - This allows the windows code to compile as C99 with the VS compilers that support that
     new 133304a  PROTON-2077: Get Windows code to build as C99 not C++
     new abdfe9b  PROTON-2077: Test with VS 2015, 17 and 19 in .appveyor.yml
     new 4ffea3a  PROTON-2077: Update Azure pipeline build to build VS2019 as well

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .appveyor.yml                               | 36 +++++++++++++++++++++--------
 INSTALL.md                                  | 11 +++++----
 azure-pipelines/azure-pipelines.yml         | 19 ++++++++++++++-
 c/CMakeLists.txt                            |  8 +++----
 c/src/core/engine-internal.h                |  8 +++++++
 c/src/core/logger_private.h                 |  8 +++++++
 c/src/core/util.h                           |  8 +++++++
 c/src/platform/platform.h                   |  8 +++++++
 c/src/proactor/{win_iocp.c => win_iocp.cpp} | 10 ++++----
 c/src/reactor/io/windows/iocp.c             | 22 +++++++++---------
 c/src/reactor/io/windows/iocp.h             |  5 ++--
 c/src/reactor/io/windows/write_pipeline.c   |  8 +++----
 c/src/ssl/{schannel.c => schannel.cpp}      |  3 +++
 c/src/ssl/ssl-internal.h                    |  8 +++++++
 c/tools/msgr-common.c                       |  8 +++----
 python/setup.py.in                          | 35 ++++------------------------
 16 files changed, 129 insertions(+), 76 deletions(-)
 rename c/src/proactor/{win_iocp.c => win_iocp.cpp} (99%)
 rename c/src/ssl/{schannel.c => schannel.cpp} (99%)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-proton] 04/05: PROTON-2077: Test with VS 2015, 17 and 19 in .appveyor.yml

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit abdfe9b8b620d331106365bb5aabb53d220a16cb
Author: Jiri Danek <jd...@redhat.com>
AuthorDate: Thu Jul 9 22:24:25 2020 -0400

    PROTON-2077: Test with VS 2015, 17 and 19 in .appveyor.yml
    
    This borrows from changes originally proposed in GitHub PR #200.
    
    This closes #249
---
 .appveyor.yml | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 6379955..1173a7d 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,25 +1,41 @@
 version: '{branch}.{build}'
 configuration: RelWithDebInfo
 environment:
-  PYTHON: C:\Python35\python.exe
-
   matrix:
+    # https://www.appveyor.com/docs/build-environment/
+    # https://www.appveyor.com/docs/windows-images-software
+    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
+      CMAKE_GENERATOR: Visual Studio 16 2019
+      # TODO (jdanek) upgrade to Python 38 when it can be made to work; or whichever is latest at the time
+      PYTHON: "C:\\Python37-x64"
+      QPID_PROTON_CMAKE_ARGS: "-A x64"
+      VCPKG_INTEGRATION: '-DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake'
+      VCPKG_DEFAULT_TRIPLET: x64-windows
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
-      CMAKE_GENERATOR: Visual Studio 15
+      CMAKE_GENERATOR: Visual Studio 15 2017
+      PYTHON: "C:\\Python37-x64"
+      QPID_PROTON_CMAKE_ARGS: "-A x64"
       VCPKG_INTEGRATION: '-DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake'
-    - CMAKE_GENERATOR: Visual Studio 12
-    - CMAKE_GENERATOR: Visual Studio 10
+      VCPKG_DEFAULT_TRIPLET: x64-windows
+    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+      CMAKE_GENERATOR: Visual Studio 14 2015
+      PYTHON: "C:\\Python36-x64"
+      QPID_PROTON_CMAKE_ARGS: "-A x64"
+      # vcpkg is supported on VS2015, we are just not enabling the CMake integration
+      # https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2015
+
 install:
 - cinst -y swig
+# https://www.appveyor.com/docs/lang/cpp/#vc-packaging-tool
 - cd C:\Tools\vcpkg
 - git pull
 - .\bootstrap-vcpkg.bat
 - cd %APPVEYOR_BUILD_FOLDER%
-- vcpkg install jsoncpp:x86-windows
-- vcpkg install jsoncpp:x64-windows
+- vcpkg install jsoncpp
 - vcpkg integrate install
-- "%PYTHON% -m pip install --user --upgrade pip"
-- "%PYTHON% -m pip install --user --upgrade setuptools wheel tox"
+# https://pythonhosted.org/CodeChat/appveyor.yml.html
+- "%PYTHON%\\python.exe -m pip install --user --upgrade pip"
+- "%PYTHON%\\python.exe -m pip install --user --upgrade setuptools wheel tox"
 cache:
 - C:\ProgramData\chocolatey\bin -> .appveyor.yml
 - C:\ProgramData\chocolatey\lib -> .appveyor.yml
@@ -27,7 +43,7 @@ cache:
 before_build:
 - mkdir BLD
 - cd BLD
-- cmake %VCPKG_INTEGRATION% -G "%CMAKE_GENERATOR%" -DPYTHON_EXECUTABLE=%PYTHON% %QPID_PROTON_CMAKE_ARGS% ..
+- cmake %VCPKG_INTEGRATION% -G "%CMAKE_GENERATOR%" -DPYTHON_EXECUTABLE=%PYTHON%\\python.exe %QPID_PROTON_CMAKE_ARGS% ..
 - cd ..
 build:
   project: BLD/Proton.sln


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-proton] 05/05: PROTON-2077: Update Azure pipeline build to build VS2019 as well

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 4ffea3a42204b13896a1be6e14f0d4b1faab73ad
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Thu Jul 9 22:56:08 2020 -0400

    PROTON-2077: Update Azure pipeline build to build VS2019 as well
---
 azure-pipelines/azure-pipelines.yml | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/azure-pipelines/azure-pipelines.yml b/azure-pipelines/azure-pipelines.yml
index 4ba1f47..44e4a59 100644
--- a/azure-pipelines/azure-pipelines.yml
+++ b/azure-pipelines/azure-pipelines.yml
@@ -13,7 +13,24 @@ variables:
   CmakeConfigExtraArgs: ''
 
 jobs:
-- job: Windows
+- job: Windows_VS2019
+  variables:
+    CmakeConfigExtraArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
+  pool:
+    vmImage: 'windows-2019'
+  steps:
+  - task: UsePythonVersion@0
+    inputs:
+      versionSpec: $(PythonVersion)
+      addToPath: true
+      architecture: $(PythonArch)
+  - script: |
+      choco install swig
+      vcpkg install jsoncpp
+      vcpkg integrate install
+    name: InstallExtraStuff
+  - template: steps.yml
+- job: Windows_VS2017
   variables:
     PythonArch: 'x86'
     CmakeConfigExtraArgs: '-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-proton] 02/05: PROTON-2077: The win_iocp code is really C++ - This allows the windows code to compile as C99 with the VS compilers that support that

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit e3d8547f18920d62f48b8382777246359e3760d0
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Fri May 1 16:32:51 2020 -0400

    PROTON-2077: The win_iocp code is really C++
    - This allows the windows code to compile as C99 with the VS compilers that support that
---
 c/CMakeLists.txt                            |  2 +-
 c/src/proactor/{win_iocp.c => win_iocp.cpp} | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt
index 44a9745..13a3b67 100644
--- a/c/CMakeLists.txt
+++ b/c/CMakeLists.txt
@@ -356,7 +356,7 @@ endif()
 if (PROACTOR STREQUAL "iocp" OR (NOT PROACTOR AND NOT PROACTOR_OK))
   if(WIN32 AND NOT CYGWIN)
     set (PROACTOR_OK iocp)
-    set (qpid-proton-proactor src/proactor/win_iocp.c src/proactor/proactor-internal.c)
+    set (qpid-proton-proactor src/proactor/win_iocp.cpp src/proactor/proactor-internal.c)
     set_source_files_properties (${qpid-proton-proactor} PROPERTIES
       COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS} ${LTO}"
       COMPILE_DEFINITIONS "${PLATFORM_DEFINITIONS}"
diff --git a/c/src/proactor/win_iocp.c b/c/src/proactor/win_iocp.cpp
similarity index 99%
rename from c/src/proactor/win_iocp.c
rename to c/src/proactor/win_iocp.cpp
index ae5a369..d4af496 100644
--- a/c/src/proactor/win_iocp.c
+++ b/c/src/proactor/win_iocp.cpp
@@ -34,15 +34,15 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <queue>
+
+#include <iostream>
 #include <list>
+#include <queue>
+#include <sstream>
 
 #include <winsock2.h>
 #include <mswsock.h>
-#include <Ws2tcpip.h>
-
-#include <iostream>
-#include <sstream>
+#include <ws2tcpip.h>
 
 #include "netaddr-internal.h" /* Include after socket/inet headers */
 #include "core/logger_private.h"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-proton] 03/05: PROTON-2077: Get Windows code to build as C99 not C++

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 133304af30d66d5409127ed271bdde9d3ee94887
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Fri May 8 18:57:42 2020 -0400

    PROTON-2077: Get Windows code to build as C99 not C++
---
 c/CMakeLists.txt                          |  6 +++---
 c/src/core/engine-internal.h              |  8 +++++++
 c/src/core/logger_private.h               |  8 +++++++
 c/src/core/util.h                         |  8 +++++++
 c/src/platform/platform.h                 |  8 +++++++
 c/src/reactor/io/windows/iocp.c           | 22 +++++++++----------
 c/src/reactor/io/windows/iocp.h           |  5 +++--
 c/src/reactor/io/windows/write_pipeline.c |  8 +++----
 c/src/ssl/{schannel.c => schannel.cpp}    |  3 +++
 c/src/ssl/ssl-internal.h                  |  8 +++++++
 c/tools/msgr-common.c                     |  8 +++----
 python/setup.py.in                        | 35 ++++---------------------------
 12 files changed, 72 insertions(+), 55 deletions(-)

diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt
index 13a3b67..57e6843 100644
--- a/c/CMakeLists.txt
+++ b/c/CMakeLists.txt
@@ -80,7 +80,7 @@ add_custom_target(
   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h
   )
 
-file (GLOB_RECURSE source_files "src/*.[ch]")
+file (GLOB_RECURSE source_files "src/*.h" "src/*.c" "src/*.cpp")
 
 foreach (sfile ${source_files})
   file (RELATIVE_PATH rfile ${CMAKE_CURRENT_SOURCE_DIR} ${sfile})
@@ -118,7 +118,7 @@ if (SSL_IMPL STREQUAL openssl)
   set (pn_ssl_impl src/ssl/openssl.c)
   set (SSL_LIB OpenSSL::SSL Threads::Threads)
 elseif (SSL_IMPL STREQUAL schannel)
-  set (pn_ssl_impl src/ssl/schannel.c)
+  set (pn_ssl_impl src/ssl/schannel.cpp)
   set (SSL_LIB Crypt32.lib Secur32.lib)
 else ()
   set (pn_ssl_impl src/ssl/ssl_stub.c)
@@ -226,7 +226,7 @@ set (qpid-proton-layers-all
   src/sasl/cyrus_sasl.c
   src/sasl/cyrus_stub.c
   src/ssl/openssl.c
-  src/ssl/schannel.c
+  src/ssl/schannel.cpp
   src/ssl/ssl_stub.c
   )
 
diff --git a/c/src/core/engine-internal.h b/c/src/core/engine-internal.h
index 0df2d2f..ba6c051 100644
--- a/c/src/core/engine-internal.h
+++ b/c/src/core/engine-internal.h
@@ -31,6 +31,10 @@
 #include "logger_private.h"
 #include "util.h"
 
+#if __cplusplus
+extern "C" {
+#endif
+
 typedef enum pn_endpoint_type_t {CONNECTION, SESSION, SENDER, RECEIVER} pn_endpoint_type_t;
 
 typedef struct pn_endpoint_t pn_endpoint_t;
@@ -377,4 +381,8 @@ typedef enum {IN, OUT} pn_dir_t;
 void pn_do_trace(pn_transport_t *transport, uint16_t ch, pn_dir_t dir,
                  pn_data_t *args, const char *payload, size_t size);
 
+#if __cplusplus
+}
+#endif
+
 #endif /* engine-internal.h */
diff --git a/c/src/core/logger_private.h b/c/src/core/logger_private.h
index 9c6231b..12c717d 100644
--- a/c/src/core/logger_private.h
+++ b/c/src/core/logger_private.h
@@ -21,6 +21,10 @@
 
 #include <proton/logger.h>
 
+#if __cplusplus
+extern "C" {
+#endif
+
 struct pn_logger_t {
     pn_log_sink_t sink;
     intptr_t      sink_context;
@@ -56,4 +60,8 @@ void pni_logger_log_data(pn_logger_t *logger, pn_log_subsystem_t subsystem, pn_l
             pni_logger_log_data(logger, (pn_log_subsystem_t) (subsys), (pn_log_level_t) (sev), __VA_ARGS__); \
     } while(0)
 
+#if __cplusplus
+}
+#endif
+
 #endif
diff --git a/c/src/core/util.h b/c/src/core/util.h
index 9ae62ea..ea049fd 100644
--- a/c/src/core/util.h
+++ b/c/src/core/util.h
@@ -34,6 +34,10 @@
 #include <proton/types.h>
 #include <proton/object.h>
 
+#if __cplusplus
+extern "C" {
+#endif
+
 ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size);
 int pn_quote(pn_string_t *dst, const char *src, size_t size);
 bool pn_env_bool(const char *name);
@@ -119,4 +123,8 @@ static inline pn_bytes_t pn_string_bytes(pn_string_t *s) {
 #define pn_min(X,Y) ((X) > (Y) ? (Y) : (X))
 #define pn_max(X,Y) ((X) < (Y) ? (Y) : (X))
 
+#if __cplusplus
+}
+#endif
+
 #endif /* util.h */
diff --git a/c/src/platform/platform.h b/c/src/platform/platform.h
index c993bb9..1b83429 100644
--- a/c/src/platform/platform.h
+++ b/c/src/platform/platform.h
@@ -25,6 +25,10 @@
 #include "proton/types.h"
 #include "proton/error.h"
 
+#if __cplusplus
+extern "C" {
+#endif
+
 /** Get the current PID
  *
  * @return process id
@@ -87,4 +91,8 @@ int pni_vsnprintf(char *buf, size_t count, const char *fmt, va_list ap);
 #endif
 #endif
 
+#if __cplusplus
+}
+#endif
+
 #endif /* platform.h */
diff --git a/c/src/reactor/io/windows/iocp.c b/c/src/reactor/io/windows/iocp.c
index 8a1a64a..30f1bce 100644
--- a/c/src/reactor/io/windows/iocp.c
+++ b/c/src/reactor/io/windows/iocp.c
@@ -66,7 +66,7 @@
 // all together when accepting the connection. Reserve enough for
 // IPv6 addresses, even if the socket is IPv4. The 16 bytes padding
 // per address is required by AcceptEx.
-#define IOCP_SOCKADDRMAXLEN (sizeof(sockaddr_in6) + 16)
+#define IOCP_SOCKADDRMAXLEN (sizeof(struct sockaddr_in6) + 16)
 #define IOCP_SOCKADDRBUFLEN (2 * IOCP_SOCKADDRMAXLEN)
 
 static void iocp_log(const char *fmt, ...)
@@ -145,9 +145,9 @@ static LPFN_GETACCEPTEXSOCKADDRS lookup_get_accept_ex_sockaddrs(SOCKET s)
 // match accept socket to listener socket
 static iocpdesc_t *create_same_type_socket(iocpdesc_t *iocpd)
 {
-  sockaddr_storage sa;
+  struct sockaddr_storage sa;
   socklen_t salen = sizeof(sa);
-  if (getsockname(iocpd->socket, (sockaddr*)&sa, &salen) == -1)
+  if (getsockname(iocpd->socket, (struct sockaddr*)&sa, &salen) == -1)
     return NULL;
   SOCKET s = socket(sa.ss_family, SOCK_STREAM, 0); // Currently only work with SOCK_STREAM
   if (s == INVALID_SOCKET)
@@ -192,6 +192,7 @@ struct pni_acceptor_t {
   LPFN_GETACCEPTEXSOCKADDRS fn_get_accept_ex_sockaddrs;
 };
 
+#define CID_pni_acceptor CID_pn_void
 #define pni_acceptor_compare NULL
 #define pni_acceptor_inspect NULL
 #define pni_acceptor_hashcode NULL
@@ -213,7 +214,6 @@ static void pni_acceptor_finalize(void *object)
 
 static pni_acceptor_t *pni_acceptor(iocpdesc_t *iocpd)
 {
-  static const pn_cid_t CID_pni_acceptor = CID_pn_void;
   static const pn_class_t clazz = PN_CLASS(pni_acceptor);
   pni_acceptor_t *acceptor = (pni_acceptor_t *) pn_class_new(&clazz, sizeof(pni_acceptor_t));
   acceptor->listen_sock = iocpd;
@@ -289,7 +289,7 @@ static void complete_accept(accept_result_t *result, HRESULT status)
   }
 }
 
-pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, sockaddr *addr, socklen_t *addrlen, bool *would_block, pn_error_t *error)
+pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, struct sockaddr *addr, socklen_t *addrlen, bool *would_block, pn_error_t *error)
 {
   if (!is_listener(ld)) {
     set_iocp_error_status(error, PN_ERR, WSAEOPNOTSUPP);
@@ -325,8 +325,8 @@ pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, sockaddr *addr, socklen_t *addrl
     setsockopt(accept_sock, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char*)&ld->socket,
                   sizeof (SOCKET));
     if (addr && addrlen && *addrlen > 0) {
-      sockaddr_storage *local_addr = NULL;
-      sockaddr_storage *remote_addr = NULL;
+      struct sockaddr_storage *local_addr = NULL;
+      struct sockaddr_storage *remote_addr = NULL;
       int local_addrlen, remote_addrlen;
       LPFN_GETACCEPTEXSOCKADDRS fn = ld->acceptor->fn_get_accept_ex_sockaddrs;
       fn(result->address_buffer, 0, IOCP_SOCKADDRMAXLEN, IOCP_SOCKADDRMAXLEN,
@@ -358,6 +358,7 @@ typedef struct {
   struct addrinfo *addrinfo;
 } connect_result_t;
 
+#define CID_connect_result CID_pn_void
 #define connect_result_initialize NULL
 #define connect_result_compare NULL
 #define connect_result_inspect NULL
@@ -372,7 +373,6 @@ static void connect_result_finalize(void *object)
 }
 
 static connect_result_t *connect_result(iocpdesc_t *iocpd, struct addrinfo *addr) {
-  static const pn_cid_t CID_connect_result = CID_pn_void;
   static const pn_class_t clazz = PN_CLASS(connect_result);
   connect_result_t *result = (connect_result_t *) pn_class_new(&clazz, sizeof(connect_result_t));
   if (result) {
@@ -389,7 +389,7 @@ pn_socket_t pni_iocp_begin_connect(iocp_t *iocp, pn_socket_t sock, struct addrin
   // addr lives for the duration of the async connect.  Caller has passed ownership here.
   // See connect_result_finalize().
   // Use of Windows-specific ConnectEx() requires our socket to be "loosely" pre-bound:
-  sockaddr_storage sa;
+  struct sockaddr_storage sa;
   memset(&sa, 0, sizeof(sa));
   sa.ss_family = addr->ai_family;
   if (bind(sock, (SOCKADDR *) &sa, addr->ai_addrlen)) {
@@ -747,13 +747,13 @@ static uintptr_t pni_iocpdesc_hashcode(void *object)
   return iocpd->socket;
 }
 
+#define CID_pni_iocpdesc CID_pn_void
 #define pni_iocpdesc_compare NULL
 #define pni_iocpdesc_inspect NULL
 
 // Reference counted in the iocpdesc map, zombie_list, selector.
 static iocpdesc_t *pni_iocpdesc(pn_socket_t s)
 {
-  static const pn_cid_t CID_pni_iocpdesc = CID_pn_void;
   static pn_class_t clazz = PN_CLASS(pni_iocpdesc);
   iocpdesc_t *iocpd = (iocpdesc_t *) pn_class_new(&clazz, sizeof(iocpdesc_t));
   assert(iocpd);
@@ -1130,6 +1130,7 @@ void pni_iocp_begin_close(iocpdesc_t *iocpd)
 
 // === iocp_t
 
+#define CID_pni_iocp CID_pn_void
 #define pni_iocp_hashcode NULL
 #define pni_iocp_compare NULL
 #define pni_iocp_inspect NULL
@@ -1172,7 +1173,6 @@ void pni_iocp_finalize(void *obj)
 
 iocp_t *pni_iocp()
 {
-  static const pn_cid_t CID_pni_iocp = CID_pn_void;
   static const pn_class_t clazz = PN_CLASS(pni_iocp);
   iocp_t *iocp = (iocp_t *) pn_class_new(&clazz, sizeof(iocp_t));
   return iocp;
diff --git a/c/src/reactor/io/windows/iocp.h b/c/src/reactor/io/windows/iocp.h
index 6cf0bc0..d3018e4 100644
--- a/c/src/reactor/io/windows/iocp.h
+++ b/c/src/reactor/io/windows/iocp.h
@@ -30,6 +30,7 @@ typedef struct pni_acceptor_t pni_acceptor_t;
 typedef struct write_result_t write_result_t;
 typedef struct read_result_t read_result_t;
 typedef struct write_pipeline_t write_pipeline_t;
+typedef struct iocp_t iocp_t;
 typedef struct iocpdesc_t iocpdesc_t;
 
 
@@ -81,7 +82,7 @@ struct iocpdesc_t {
   iocpdesc_t *triggered_list_prev;
   iocpdesc_t *deadlines_next;
   iocpdesc_t *deadlines_prev;
-  pn_timestamp_t reap_time;;
+  pn_timestamp_t reap_time;
 };
 
 typedef enum { IOCP_ACCEPT, IOCP_CONNECT, IOCP_READ, IOCP_WRITE } iocp_type_t;
@@ -109,7 +110,7 @@ void pni_iocpdesc_start(iocpdesc_t *iocpd);
 void pni_iocp_drain_completions(iocp_t *);
 int pni_iocp_wait_one(iocp_t *, int timeout, pn_error_t *);
 void pni_iocp_start_accepting(iocpdesc_t *iocpd);
-pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, sockaddr *addr, socklen_t *addrlen, bool *would_block, pn_error_t *error);
+pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, struct sockaddr *addr, socklen_t *addrlen, bool *would_block, pn_error_t *error);
 pn_socket_t pni_iocp_begin_connect(iocp_t *, pn_socket_t sock, struct addrinfo *addr, pn_error_t *error);
 ssize_t pni_iocp_begin_write(iocpdesc_t *, const void *, size_t, bool *, pn_error_t *);
 ssize_t pni_iocp_recv(iocpdesc_t *iocpd, void *buf, size_t size, bool *would_block, pn_error_t *error);
diff --git a/c/src/reactor/io/windows/write_pipeline.c b/c/src/reactor/io/windows/write_pipeline.c
index 238303c..ffe5c20 100644
--- a/c/src/reactor/io/windows/write_pipeline.c
+++ b/c/src/reactor/io/windows/write_pipeline.c
@@ -146,6 +146,7 @@ struct write_pipeline_t {
   bool is_writer;
 };
 
+#define CID_write_pipeline CID_pn_void
 #define write_pipeline_compare NULL
 #define write_pipeline_inspect NULL
 #define write_pipeline_hashcode NULL
@@ -169,7 +170,6 @@ static void write_pipeline_finalize(void *object)
 
 write_pipeline_t *pni_write_pipeline(iocpdesc_t *iocpd)
 {
-  static const pn_cid_t CID_write_pipeline = CID_pn_void;
   static const pn_class_t clazz = PN_CLASS(write_pipeline);
   write_pipeline_t *pipeline = (write_pipeline_t *) pn_class_new(&clazz, sizeof(write_pipeline_t));
   pipeline->iocpd = iocpd;
@@ -205,13 +205,13 @@ static void remove_as_writer(write_pipeline_t *pl)
 static void set_depth(write_pipeline_t *pl)
 {
   pl->depth = 1;
-  sockaddr_storage sa;
+  struct sockaddr_storage sa;
   socklen_t salen = sizeof(sa);
   char buf[INET6_ADDRSTRLEN];
   DWORD buflen = sizeof(buf);
 
-  if (getsockname(pl->iocpd->socket,(sockaddr*) &sa, &salen) == 0 &&
-      getnameinfo((sockaddr*) &sa, salen, buf, buflen, NULL, 0, NI_NUMERICHOST) == 0) {
+  if (getsockname(pl->iocpd->socket,(struct sockaddr*) &sa, &salen) == 0 &&
+      getnameinfo((struct sockaddr*) &sa, salen, buf, buflen, NULL, 0, NI_NUMERICHOST) == 0) {
     if ((sa.ss_family == AF_INET6 && strcmp(buf, "::1")) ||
         (sa.ss_family == AF_INET && strncmp(buf, "127.", 4))) {
       // not loopback
diff --git a/c/src/ssl/schannel.c b/c/src/ssl/schannel.cpp
similarity index 99%
rename from c/src/ssl/schannel.c
rename to c/src/ssl/schannel.cpp
index 18073f8..845db61 100644
--- a/c/src/ssl/schannel.c
+++ b/c/src/ssl/schannel.cpp
@@ -52,6 +52,7 @@
 #include <WinInet.h>
 #undef SECURITY_WIN32
 
+extern "C" {
 
 /** @file
  * SSL/TLS support API.
@@ -2340,3 +2341,5 @@ static HRESULT verify_peer(pni_ssl_t *ssl, HCERTSTORE root_store, const char *se
   free(nameUCS2);
   return error;
 }
+
+}
diff --git a/c/src/ssl/ssl-internal.h b/c/src/ssl/ssl-internal.h
index d3205ea..3121e6f 100644
--- a/c/src/ssl/ssl-internal.h
+++ b/c/src/ssl/ssl-internal.h
@@ -30,7 +30,15 @@
  *
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 // release the SSL context
 void pn_ssl_free(pn_transport_t *transport);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* ssl-internal.h */
diff --git a/c/tools/msgr-common.c b/c/tools/msgr-common.c
index 7c43a45..e9c285c 100644
--- a/c/tools/msgr-common.c
+++ b/c/tools/msgr-common.c
@@ -64,7 +64,7 @@ void addresses_free( Addresses_t *a )
     int i;
     for (i = 0; i < a->count; i++)
       if (a->addresses[i]) free( (void *)a->addresses[i] );
-    free( a->addresses );
+    free( (void *) a->addresses );
     a->addresses = NULL;
   }
 }
@@ -158,15 +158,15 @@ void parse_password( const char *input, char **password )
     }
 }
 
-static int log = 0;
+static int dolog = 0;
 void enable_logging()
 {
-    log = 1;
+    dolog = 1;
 }
 
 void LOG( const char *fmt, ... )
 {
-    if (log) {
+    if (dolog) {
         va_list ap;
         va_start(ap, fmt);
         vfprintf( stdout, fmt, ap );
diff --git a/python/setup.py.in b/python/setup.py.in
index 31fa59e..ab064b4 100644
--- a/python/setup.py.in
+++ b/python/setup.py.in
@@ -40,6 +40,9 @@ From the Python side, this scripts overrides 1 command - build_ext - and it adds
 new one. The latter - Configure - is called from the former to setup/discover what's
 in the system. The rest of the commands and steps are done normally without any kind
 of monkey patching.
+
+TODO: On windows we now only support VS2015 and above and python 3, we should check
+for this and produce an appropriate error if the requirements are not met.
 """
 
 import os
@@ -151,7 +154,7 @@ class Configure(build_ext):
             sources.append(os.path.join(proton_src, 'ssl', 'openssl.c'))
         elif os.name=='nt':
             libraries += ['crypt32', 'secur32']
-            sources.append(os.path.join(proton_src, 'ssl', 'schannel.c'))
+            sources.append(os.path.join(proton_src, 'ssl', 'schannel.cpp'))
         else:
             sources.append(os.path.join(proton_src, 'ssl', 'ssl_stub.c'))
             log.warn("OpenSSL not installed - disabling SSL support!")
@@ -183,36 +186,6 @@ class Configure(build_ext):
             log.warn("Windows - only the ANONYMOUS and PLAIN mechanisms will be supported!")
             sources.append(os.path.join(proton_src, 'sasl', 'cyrus_stub.c'))
 
-        # Hack for Windows/msvc: We need to compile proton as C++, but it seems the only way to
-        # force this in setup.py is to use a .cpp extension! So copy all the source files to .cpp
-        # and use these as the compile sources
-        if self.compiler_type=='msvc':
-            targets = []
-            target_base = os.path.join(self.build_temp, 'srcs')
-            try:
-                # Might need to make intermediate directories use os.makedirs() not os.mkdir()
-                os.makedirs(target_base)
-            except OSError:
-                pass
-
-            for f in sources:
-                # We know each file ends in '.c' as we filtered on that above so just add 'pp' to end
-                target = os.path.join(target_base, os.path.basename(f) + 'pp')
-                shutil.copy(f, target)
-                targets.append(target)
-
-            # Copy .h files into temp tree too as we need them to compile
-            for root, _, files in os.walk(proton_core_src):
-                for file_ in files:
-                    if file_.endswith('.h'):
-                        shutil.copy(os.path.join(root, file_), os.path.join(target_base, file_))
-
-            # Copy ssl/sasl .h files
-            shutil.copy(os.path.join(proton_src, 'sasl', 'sasl-internal.h'), os.path.join(target_base, 'sasl-internal.h'))
-            shutil.copy(os.path.join(proton_src, 'ssl', 'ssl-internal.h'), os.path.join(target_base, 'ssl-internal.h'))
-
-            sources = targets
-
         # compile all the proton sources.  We'll add the resulting list of
         # objects to the _cproton extension as 'extra objects'.  We do this
         # instead of just lumping all the sources into the extension to prevent


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-proton] 01/05: PROTON-2077: Update documentation for changed Windows minimum requirements

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 5ecfd8c2bfcf65cd3c35902197b3e1fe91b8447e
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Mon Jul 6 13:37:48 2020 -0400

    PROTON-2077: Update documentation for changed Windows minimum requirements
---
 INSTALL.md | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/INSTALL.md b/INSTALL.md
index 76f56f6..38fcc79 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -10,8 +10,8 @@ Dependencies
 Cross-platform dependencies
 
   - CMake 2.8.12+
+  - Python (required to build core C library, minimum version depends on platform)
   - Swig 1.3+ (for the bindings)
-  - Python 2.6+ (for the Python binding)
   - Ruby 1.9+ (for the Ruby binding)
   - Go 1.11+ (for the Go binding)
 
@@ -22,10 +22,12 @@ Linux dependencies
   - Cyrus SASL 2.1+ (for SASL support)
   - OpenSSL 1.0+ (for SSL support)
   - JsonCpp 1.8+ for C++ connection configuration file support
+  - Python 2.6+ (for the Python binding)
 
 Windows dependencies
 
-  - Visual Studio 2013 or newer (regular or C++ Express)
+  - Visual Studio 2015 or newer (regular or C++ Express)
+  - Python 3.5+ (for the Python binding)
 
 CMake (Linux)
 -------------
@@ -107,7 +109,7 @@ Studio and used to build the Proton library.
 
 The following packages must be installed:
 
-  - Visual Studio 2013 or newer (regular or C++ Express)
+  - Visual Studio 2015 or newer (regular or C++ Express)
   - Python (www.python.org)
   - CMake (www.cmake.org)
 
@@ -117,9 +119,10 @@ Additional packages are required for the language bindings:
   - Development headers and libraries for the language of choice
 
 Notes:
-
   - Be sure to install relevant Microsoft Service Packs and updates
   - python.exe, cmake.exe and swig.exe _must_ all be added to your PATH
+  - Chocolatey is a useful tool that can be used to install cmake, python
+    and swig (see https://chocolatey.org/)
 
 To generate the Visual Studio project files, from the directory where you found
 this `INSTALL.md` file:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org