Skip to content

Commit

Permalink
Fix libxml2 v2.12.0 includes (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsh123 authored Nov 20, 2023
1 parent 325132b commit ffb3273
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions apps/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#endif

#include <string.h>
#include <stdlib.h>

#include <xmlsec/xmlsec.h>
#include <xmlsec/keys.h>
Expand Down
3 changes: 2 additions & 1 deletion apps/xmlsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libxml/xmlsave.h>
#include <libxml/xpathInternals.h>

#ifndef XMLSEC_NO_XSLT
Expand Down Expand Up @@ -3030,7 +3031,7 @@ xmlSecAppInit(void) {
/* Init libxml */
xmlInitParser();
LIBXML_TEST_VERSION
xmlTreeIndentString = "\t";
xmlThrDefTreeIndentString("\t");
#ifndef XMLSEC_NO_XSLT
xmlIndentTreeOutput = 1;
#endif /* XMLSEC_NO_XSLT */
Expand Down
1 change: 1 addition & 0 deletions include/xmlsec/xmlsec.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define __XMLSEC_H__

#include <libxml/tree.h>
#include <libxml/parser.h>

#include <xmlsec/version.h>
#include <xmlsec/exports.h>
Expand Down
10 changes: 5 additions & 5 deletions src/errors_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ extern "C" {
*/
#define xmlSecXmlError(errorFunction, errorObject) \
{ \
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, \
Expand All @@ -159,7 +159,7 @@ extern "C" {
*/
#define xmlSecXmlError2(errorFunction, errorObject, msg, param) \
{ \
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, \
Expand All @@ -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, \
Expand All @@ -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, \
Expand All @@ -227,7 +227,7 @@ extern "C" {
*/
#define xmlSecXsltError(errorFunction, ctxt, errorObject) \
{ \
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, \
Expand Down
1 change: 1 addition & 0 deletions src/mscrypto/certkeys.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "globals.h"

#include <string.h>
#include <stdlib.h>

#ifndef XMLSEC_NO_GOST
#include "csp_oid.h"
Expand Down
1 change: 1 addition & 0 deletions src/mscrypto/signatures.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "globals.h"

#include <string.h>
#include <stdlib.h>

#ifndef XMLSEC_NO_GOST
#include "csp_calg.h"
Expand Down

1 comment on commit ffb3273

@kloczek
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to release new version because of this commit.
Doable? 🤔

Please sign in to comment.