Skip to content

Commit

Permalink
Trying a windows friendly patch file
Browse files Browse the repository at this point in the history
  • Loading branch information
disa6302 committed Oct 24, 2023
1 parent 9e5d47e commit a6c7de2
Showing 1 changed file with 59 additions and 56 deletions.
115 changes: 59 additions & 56 deletions CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -1,56 +1,59 @@
diff --git a/lib/roles/h2/hpack.c b/lib/roles/h2/hpack.c
index 68629e6f..6ef628b8 100644
--- a/lib/roles/h2/hpack.c
+++ b/lib/roles/h2/hpack.c
@@ -1110,7 +1110,7 @@ pre_data:

for (n = 0; n < 8; n++) {
if (h2n->huff) {
- char b = (c >> 7) & 1;
+ char b = (char)((c >> 7) & 1);
prev = h2n->hpack_pos;
h2n->hpack_pos = (uint16_t)huftable_decode(
(int)h2n->hpack_pos, b);
diff --git a/lib/tls/CMakeLists.txt b/lib/tls/CMakeLists.txt
index b214df75..06eaf255 100644
--- a/lib/tls/CMakeLists.txt
+++ b/lib/tls/CMakeLists.txt
@@ -57,10 +57,10 @@ if (LWS_WITH_BORINGSSL)
endif()

if (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS)
- if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "")
+ if (("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" AND ("${LWS_OPENSSL_SSL_LIBRARY}" STREQUAL "" OR "${LWS_OPENSSL_CRYPTO_LIBRARY}" STREQUAL "")) OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "")
else()
if (NOT LWS_PLAT_FREERTOS)
- set(OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES})
+ list(APPEND OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES} ${LWS_OPENSSL_SSL_LIBRARY} ${LWS_OPENSSL_CRYPTO_LIBRARY})
endif()
set(OPENSSL_INCLUDE_DIRS ${LWS_OPENSSL_INCLUDE_DIRS})
set(OPENSSL_FOUND 1)
@@ -248,7 +248,9 @@ if (LWS_WITH_SSL)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_OPENSSL openssl QUIET)
find_package(OpenSSL REQUIRED)
- list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES})
+ if (NOT LWS_WITH_STATIC)
+ list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES})
+ endif()
set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE)
endif()
set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}")
diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c
index d149d8675..b319d79f4 100644
--- a/lib/core/lws_map.c
+++ b/lib/core/lws_map.c
@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable {
lws_dll2_owner_t ho;
} lws_map_hashtable_t;
-typedef struct lws_map {
+struct lws_map {
lws_map_info_t info;
/* array of info.modulo x lws_map_hashtable_t overallocated */
-} lws_map_t;
+};
typedef struct lws_map_item {
lws_dll2_t list; /* owned by hashtable */
diff --git a/lib/roles/h2/hpack.c b/lib/roles/h2/hpack.c
index 68629e6f..6ef628b8 100644
--- a/lib/roles/h2/hpack.c
+++ b/lib/roles/h2/hpack.c
@@ -1110,7 +1110,7 @@ pre_data:

for (n = 0; n < 8; n++) {
if (h2n->huff) {
- char b = (c >> 7) & 1;
+ char b = (char)((c >> 7) & 1);
prev = h2n->hpack_pos;
h2n->hpack_pos = (uint16_t)huftable_decode(
(int)h2n->hpack_pos, b);
diff --git a/lib/tls/CMakeLists.txt b/lib/tls/CMakeLists.txt
index b214df75..06eaf255 100644
--- a/lib/tls/CMakeLists.txt
+++ b/lib/tls/CMakeLists.txt
@@ -57,10 +57,10 @@ if (LWS_WITH_BORINGSSL)
endif()

if (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS)
- if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "")
+ if (("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" AND ("${LWS_OPENSSL_SSL_LIBRARY}" STREQUAL "" OR "${LWS_OPENSSL_CRYPTO_LIBRARY}" STREQUAL "")) OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "")
else()
if (NOT LWS_PLAT_FREERTOS)
- set(OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES})
+ list(APPEND OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES} ${LWS_OPENSSL_SSL_LIBRARY} ${LWS_OPENSSL_CRYPTO_LIBRARY})
endif()
set(OPENSSL_INCLUDE_DIRS ${LWS_OPENSSL_INCLUDE_DIRS})
set(OPENSSL_FOUND 1)
@@ -248,7 +248,9 @@ if (LWS_WITH_SSL)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_OPENSSL openssl QUIET)
find_package(OpenSSL REQUIRED)
- list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES})
+ if (NOT LWS_WITH_STATIC)
+ list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES})
+ endif()
set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE)
endif()
set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}")
diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c
index d149d8675..b319d79f4 100644
--- a/lib/core/lws_map.c
+++ b/lib/core/lws_map.c
@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable {
lws_dll2_owner_t ho;
} lws_map_hashtable_t;

-typedef struct lws_map {
+struct lws_map {
lws_map_info_t info;

/* array of info.modulo x lws_map_hashtable_t overallocated */
-} lws_map_t;
+};

typedef struct lws_map_item {
lws_dll2_t list; /* owned by hashtable */

0 comments on commit a6c7de2

Please sign in to comment.