From ce524ef0b68de5dcb4de543b6b1c2d0fa00a103a Mon Sep 17 00:00:00 2001 From: Aleksey Sanin Date: Wed, 20 Dec 2023 17:51:10 -0500 Subject: [PATCH 1/4] (mingw) Fix MinGW build error for new LibXML2 headers --- src/errors_helpers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/errors_helpers.h b/src/errors_helpers.h index 21f9584a4..002fb5e67 100644 --- a/src/errors_helpers.h +++ b/src/errors_helpers.h @@ -136,7 +136,7 @@ extern "C" { */ #define xmlSecXmlError(errorFunction, errorObject) \ { \ - xmlErrorPtr error = xmlGetLastError(); \ + const xmlErrorPtr error = xmlGetLastError(); \ int code = (error != NULL) ? error->code : 0; \ const char* message = (error != NULL) ? error->message : NULL; \ xmlSecError(XMLSEC_ERRORS_HERE, \ @@ -159,7 +159,7 @@ extern "C" { */ #define xmlSecXmlError2(errorFunction, errorObject, msg, param) \ { \ - xmlErrorPtr error = xmlGetLastError(); \ + const xmlErrorPtr error = xmlGetLastError(); \ int code = (error != NULL) ? error->code : 0; \ const char* message = (error != NULL) ? error->message : NULL; \ xmlSecError(XMLSEC_ERRORS_HERE, \ @@ -227,7 +227,7 @@ extern "C" { */ #define xmlSecXsltError(errorFunction, ctxt, errorObject) \ { \ - xmlErrorPtr error = xmlGetLastError(); \ + const xmlErrorPtr error = xmlGetLastError(); \ int code = (error != NULL) ? error->code : 0; \ const char* message = (error != NULL) ? error->message : NULL; \ xmlSecError(XMLSEC_ERRORS_HERE, \ From d09a64ee13da92582cc12586a8fe84b665e83a75 Mon Sep 17 00:00:00 2001 From: Aleksey Sanin Date: Wed, 20 Dec 2023 18:30:53 -0500 Subject: [PATCH 2/4] Second try --- src/errors_helpers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/errors_helpers.h b/src/errors_helpers.h index 002fb5e67..8d9cc1de1 100644 --- a/src/errors_helpers.h +++ b/src/errors_helpers.h @@ -136,7 +136,7 @@ extern "C" { */ #define xmlSecXmlError(errorFunction, errorObject) \ { \ - const xmlErrorPtr error = xmlGetLastError(); \ + const xmlError * error = xmlGetLastError(); \ int code = (error != NULL) ? error->code : 0; \ const char* message = (error != NULL) ? error->message : NULL; \ xmlSecError(XMLSEC_ERRORS_HERE, \ @@ -159,7 +159,7 @@ extern "C" { */ #define xmlSecXmlError2(errorFunction, errorObject, msg, param) \ { \ - const xmlErrorPtr error = xmlGetLastError(); \ + const xmlError * error = xmlGetLastError(); \ int code = (error != NULL) ? error->code : 0; \ const char* message = (error != NULL) ? error->message : NULL; \ xmlSecError(XMLSEC_ERRORS_HERE, \ @@ -227,7 +227,7 @@ extern "C" { */ #define xmlSecXsltError(errorFunction, ctxt, errorObject) \ { \ - const xmlErrorPtr error = xmlGetLastError(); \ + const xmlError * error = xmlGetLastError(); \ int code = (error != NULL) ? error->code : 0; \ const char* message = (error != NULL) ? error->message : NULL; \ xmlSecError(XMLSEC_ERRORS_HERE, \ From 65f7f343e9c080cb0189780d72419ee3a2b4a61d Mon Sep 17 00:00:00 2001 From: Aleksey Sanin Date: Wed, 20 Dec 2023 18:38:32 -0500 Subject: [PATCH 3/4] Third try --- src/errors_helpers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/errors_helpers.h b/src/errors_helpers.h index 8d9cc1de1..52fb69c7d 100644 --- a/src/errors_helpers.h +++ b/src/errors_helpers.h @@ -181,7 +181,7 @@ extern "C" { */ #define xmlSecXmlParserError(errorFunction, ctxt, errorObject) \ { \ - xmlErrorPtr error = xmlCtxtGetLastError(ctxt);\ + const xmlError * error = xmlCtxtGetLastError(ctxt);\ int code = (error != NULL) ? error->code : 0; \ const char* message = (error != NULL) ? error->message : NULL; \ xmlSecError(XMLSEC_ERRORS_HERE, \ @@ -205,7 +205,7 @@ extern "C" { */ #define xmlSecXmlParserError2(errorFunction, ctxt, errorObject, msg, param) \ { \ - xmlErrorPtr error = xmlCtxtGetLastError(ctxt);\ + const xmlError * error = xmlCtxtGetLastError(ctxt);\ int code = (error != NULL) ? error->code : 0; \ const char* message = (error != NULL) ? error->message : NULL; \ xmlSecError(XMLSEC_ERRORS_HERE, \ From 7c30bd799a21fd31ab7fb1f6dd7589bb10a256a6 Mon Sep 17 00:00:00 2001 From: Aleksey Sanin Date: Wed, 20 Dec 2023 18:47:54 -0500 Subject: [PATCH 4/4] more fixes --- apps/crypto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/crypto.c b/apps/crypto.c index b40731130..defce974f 100644 --- a/apps/crypto.c +++ b/apps/crypto.c @@ -11,6 +11,7 @@ #define snprintf _snprintf #endif +#include #include #include