Fix windows xlswriter duplicate md5 symbol bug (#719)

* Add missing SOURCE_PATH before making cmake toolchain

* Fix windows xlswriter duplicate md5 symbol bug

* Add detection for patchFile to prevent duplicate patches

* Add tests
This commit is contained in:
Jerry Ma
2025-04-28 14:35:08 +08:00
committed by GitHub
parent f755d66342
commit e7d6f37e98
5 changed files with 58 additions and 9 deletions

View File

@@ -0,0 +1,30 @@
diff --git a/library/libxlsxwriter/third_party/md5/md5.c b/library/libxlsxwriter/third_party/md5/md5.c
index b235e17..ce98e18 100644
--- a/library/libxlsxwriter/third_party/md5/md5.c
+++ b/library/libxlsxwriter/third_party/md5/md5.c
@@ -35,7 +35,11 @@
* compile-time configuration.
*/
-#ifndef HAVE_OPENSSL
+#ifdef PHP_WIN32
+#include "config.w32.h"
+#endif
+
+#ifndef HAVE_OPENSSL_EXT
#include <string.h>
diff --git a/library/libxlsxwriter/third_party/md5/md5.h b/library/libxlsxwriter/third_party/md5/md5.h
index 2da44bf..3cb0a98 100644
--- a/library/libxlsxwriter/third_party/md5/md5.h
+++ b/library/libxlsxwriter/third_party/md5/md5.h
@@ -23,7 +23,7 @@
* See md5.c for more information.
*/
-#ifdef HAVE_OPENSSL
+#ifdef HAVE_OPENSSL_EXT
#include <openssl/md5.h>
#elif !defined(_MD5_H)
#define _MD5_H