Skip to content

Commit

Permalink
project: Update for 2.13.0 merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Jun 29, 2024
1 parent 9913b06 commit 1b3b805
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 258 deletions.
102 changes: 28 additions & 74 deletions SMP/SMP.patch
Original file line number Diff line number Diff line change
@@ -1,44 +1,17 @@
diff --git a/catalog.c b/catalog.c
index 945ea2c8..73902f29 100644
--- a/catalog.c
+++ b/catalog.c
@@ -74,6 +74,10 @@
#endif

#if defined(_WIN32) && defined(_MSC_VER)
+#include <winapifamily.h>
+#if defined(WINAPI_FAMILY_PARTITION) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#define getenv(x) NULL
+#endif
#undef XML_XML_DEFAULT_CATALOG
static char XML_XML_DEFAULT_CATALOG[256] = "file://" SYSCONFDIR "/xml/catalog";
#if !defined(_WINDOWS_)
@@ -3112,12 +3116,17 @@ xmlInitializeCatalog(void) {

catalogs = (const char *) getenv("XML_CATALOG_FILES");
if (catalogs == NULL)
-#if defined(_WIN32) && defined(_MSC_VER)
+#if defined(_WIN32) && defined(_MSC_VER) && (!defined(WINAPI_FAMILY_PARTITION) || !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
{
void* hmodule;
- hmodule = GetModuleHandleA("libxml2.dll");
+# ifdef _DEBUG
+# define LIBXML2_MODULE L"xml2d.dll"
+# else
+# define LIBXML2_MODULE L"xml2.dll"
+# endif
+ hmodule = GetModuleHandleW(LIBXML2_MODULE);
if (hmodule == NULL)
- hmodule = GetModuleHandleA(NULL);
+ hmodule = GetModuleHandleW(NULL);
if (hmodule != NULL) {
char buf[256];
unsigned long len = GetModuleFileNameA(hmodule, buf, 255);
diff --git a/parser.c b/parser.c
index fe0ff4e2..ac621a6b 100644
index 5f1fdcfa..0001ef9a 100644
--- a/parser.c
+++ b/parser.c
@@ -9890,7 +9890,7 @@ next_attr:
@@ -7585,7 +7585,7 @@ xmlHandleUndeclaredEntity(xmlParserCtxtPtr ctxt, const xmlChar *name) {

static xmlEntityPtr
xmlLookupGeneralEntity(xmlParserCtxtPtr ctxt, const xmlChar *name, int inAttr) {
- xmlEntityPtr ent;
+ xmlEntityPtr ent = NULL;

/*
* Predefined entities override any extra definition
@@ -9330,7 +9330,7 @@ next_attr:
if (defaults != NULL) {
for (i = 0; i < defaults->nbAttrs; i++) {
xmlDefAttr *attr = &defaults->attrs[i];
Expand All @@ -48,24 +21,10 @@ index fe0ff4e2..ac621a6b 100644
int res;

diff --git a/xmlIO.c b/xmlIO.c
index 95d27157..8844f483 100644
index d4275cbf..33d60e12 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -38,6 +38,13 @@
#include <direct.h>
#endif

+#if defined(_WIN32) && defined(_MSC_VER)
+#include <winapifamily.h>
+#if defined(WINAPI_FAMILY_PARTITION) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#define getenv(x) NULL
+#endif
+#endif
+
#ifndef S_ISDIR
# ifdef _S_ISDIR
# define S_ISDIR(x) _S_ISDIR(x)
@@ -3729,11 +3736,13 @@ xmlParserGetDirectory(const char *filename) {
@@ -2899,11 +2899,13 @@ xmlParserGetDirectory(const char *filename) {
if (cur == dir) dir[1] = 0;
else *cur = 0;
ret = xmlMemStrdup(dir);
Expand All @@ -79,29 +38,11 @@ index 95d27157..8844f483 100644
}
return(ret);
#undef IS_XMLPGD_SEP
diff --git a/xmlmemory.c b/xmlmemory.c
index 1e999b11..694c8092 100644
--- a/xmlmemory.c
+++ b/xmlmemory.c
@@ -39,6 +39,13 @@ static xmlMutex xmlMemMutex;

void xmlMallocBreakpoint(void);

+#if defined(_WIN32) && defined(_MSC_VER)
+#include <winapifamily.h>
+#if defined(WINAPI_FAMILY_PARTITION) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#define getenv(x) NULL
+#endif
+#endif
+
/************************************************************************
* *
* Macros, variables and associated types *
diff --git a/xmlmodule.c b/xmlmodule.c
index d8bce329..2118a7e8 100644
index dd2fd7a5..a80bac1f 100644
--- a/xmlmodule.c
+++ b/xmlmodule.c
@@ -316,7 +316,15 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
@@ -267,7 +267,15 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
static void *
xmlModulePlatformOpen(const char *name)
{
Expand All @@ -117,3 +58,16 @@ index d8bce329..2118a7e8 100644
}

/*
diff --git a/xpath.c b/xpath.c
index 0ddde8d4..807a748d 100644
--- a/xpath.c
+++ b/xpath.c
@@ -8481,7 +8481,7 @@ void
xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathObjectPtr val;
xmlNodePtr cur;
- xmlChar *theLang;
+ xmlChar *theLang = NULL;
const xmlChar *lang;
int ret = 0;
int i;
178 changes: 7 additions & 171 deletions SMP/libxml/xmlversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,80 +10,41 @@
#ifndef __XML_VERSION_H__
#define __XML_VERSION_H__

#include <libxml/xmlexports.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
* use those to be sure nothing nasty will happen if
* your library and includes mismatch
*/
#ifndef LIBXML2_COMPILING_MSCCDEF
XMLPUBFUN void xmlCheckVersion(int version);
#endif /* LIBXML2_COMPILING_MSCCDEF */

/**
* LIBXML_DOTTED_VERSION:
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.12.8"
#define LIBXML_DOTTED_VERSION "2.13.0"

/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 20128
#define LIBXML_VERSION 20130

/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "20128"
#define LIBXML_VERSION_STRING "20130"

/**
* LIBXML_VERSION_EXTRA:
*
* extra version information, used to show a git commit description
*/
#define LIBXML_VERSION_EXTRA "-GITv2.12.8"
#define LIBXML_VERSION_EXTRA "-GITv2.13.0"

/**
* LIBXML_TEST_VERSION:
*
* Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against
*/
#define LIBXML_TEST_VERSION xmlCheckVersion(20128);

#ifndef VMS
#if 0
/**
* WITH_TRIO:
*
* defined if the trio support need to be configured in
*/
#define WITH_TRIO
#else
/**
* WITHOUT_TRIO:
*
* defined if the trio support should not be configured in
*/
#define WITHOUT_TRIO
#endif
#else /* VMS */
/**
* WITH_TRIO:
*
* defined if the trio support need to be configured in
*/
#define WITH_TRIO 1
#endif /* VMS */
#define LIBXML_TEST_VERSION xmlCheckVersion(20130);

/**
* LIBXML_THREAD_ENABLED:
Expand Down Expand Up @@ -301,24 +262,6 @@ XMLPUBFUN void xmlCheckVersion(int version);
#define LIBXML_DEBUG_ENABLED
#endif

/**
* DEBUG_MEMORY_LOCATION:
*
* Whether the memory debugging is configured in
*/
#if 0
#define DEBUG_MEMORY_LOCATION
#endif

/**
* LIBXML_DEBUG_RUNTIME:
*
* Removed
*/
#if 0
#define LIBXML_DEBUG_RUNTIME
#endif

/**
* LIBXML_UNICODE_ENABLED:
*
Expand Down Expand Up @@ -346,17 +289,6 @@ XMLPUBFUN void xmlCheckVersion(int version);
#define LIBXML_AUTOMATA_ENABLED
#endif

/**
* LIBXML_EXPR_ENABLED:
*
* Whether the formal expressions interfaces are compiled in
*
* This code is unused and disabled unconditionally for now.
*/
#if 0
#define LIBXML_EXPR_ENABLED
#endif

/**
* LIBXML_SCHEMAS_ENABLED:
*
Expand Down Expand Up @@ -408,104 +340,8 @@ XMLPUBFUN void xmlCheckVersion(int version);
#define LIBXML_LZMA_ENABLED
#endif

#ifdef __GNUC__
/** DOC_DISABLE */

#ifndef ATTRIBUTE_UNUSED
# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))
# define ATTRIBUTE_UNUSED __attribute__((unused))
# else
# define ATTRIBUTE_UNUSED
# endif
#endif

#ifndef LIBXML_ATTR_ALLOC_SIZE
# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))
# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
# else
# define LIBXML_ATTR_ALLOC_SIZE(x)
# endif
#else
# define LIBXML_ATTR_ALLOC_SIZE(x)
#endif

#ifndef LIBXML_ATTR_FORMAT
# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
# define LIBXML_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
# else
# define LIBXML_ATTR_FORMAT(fmt,args)
# endif
#else
# define LIBXML_ATTR_FORMAT(fmt,args)
#endif

#ifndef XML_DEPRECATED
# if defined (IN_LIBXML) || (__GNUC__ * 100 + __GNUC_MINOR__ < 301)
# define XML_DEPRECATED
/* Available since at least GCC 3.1 */
# else
# define XML_DEPRECATED __attribute__((deprecated))
# endif
#endif

#if defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
#if defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 800)
#define XML_IGNORE_FPTR_CAST_WARNINGS \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#else
#define XML_IGNORE_FPTR_CAST_WARNINGS \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wpedantic\"")
#endif
#define XML_POP_WARNINGS \
_Pragma("GCC diagnostic pop")
#else
#define XML_IGNORE_FPTR_CAST_WARNINGS
#define XML_POP_WARNINGS
#endif

#else /* ! __GNUC__ */
#define ATTRIBUTE_UNUSED
#define LIBXML_ATTR_ALLOC_SIZE(x)
#define LIBXML_ATTR_FORMAT(fmt,args)
#ifndef XML_DEPRECATED
# if defined (IN_LIBXML) || !defined (_MSC_VER)
# define XML_DEPRECATED
/* Available since Visual Studio 2005 */
# elif defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_DEPRECATED __declspec(deprecated)
# endif
#endif
#if defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_IGNORE_FPTR_CAST_WARNINGS __pragma(warning(push))
#else
# define XML_IGNORE_FPTR_CAST_WARNINGS
#endif
#ifndef XML_POP_WARNINGS
# if defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_POP_WARNINGS __pragma(warning(pop))
# else
# define XML_POP_WARNINGS
# endif
#endif
#endif /* __GNUC__ */

#define XML_NO_ATTR

#ifdef LIBXML_THREAD_ENABLED
#define XML_DECLARE_GLOBAL(name, type, attrs) \
attrs XMLPUBFUN type *__##name(void);
#define XML_GLOBAL_MACRO(name) (*__##name())
#else
#define XML_DECLARE_GLOBAL(name, type, attrs) \
attrs XMLPUBVAR type name;
#endif

#ifdef __cplusplus
}
#endif /* __cplusplus */
#include <libxml/xmlexports.h>

#endif


Loading

0 comments on commit 1b3b805

Please sign in to comment.