Sfoglia il codice sorgente

Updating Expat code to C++ Builder

(before upgrade to Expat 2.4.1, the expat_config.h was not in use)

(cherry picked from commit be3cbb6867ac00c3351caadbd5f5f057a3478bf6)

Source commit: f4d67928a25d92301d3a396431fd8976158d1f3f
Martin Prikryl 4 anni fa
parent
commit
df40d3cbe3

+ 2 - 2
libs/expat/bcb5/expat_static.mak

@@ -35,9 +35,9 @@ PATHRC = .;
 LINKER = TLib
 DEBUGLIBPATH = $(BCB)\lib\debug
 RELEASELIBPATH = $(BCB)\lib\release
-USERDEFINES = _WINDOWS;WIN32;NDEBUG;_LIB;XML_STATIC
+USERDEFINES = _WINDOWS;WIN32;NDEBUG;_LIB;XML_STATIC;WINSCP
 SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL
-INCLUDEPATH = ..\lib;$(BCB)\include
+INCLUDEPATH = ..;..\lib;$(BCB)\include
 LIBPATH = ..\lib;$(BCB)\lib;$(RELEASELIBPATH)
 WARNINGS = -w-rch -w-par -w-8027 -w-8026 -w-ccc -w-8012
 LISTFILE = 

+ 3 - 3
libs/expat/expat_config.h

@@ -23,7 +23,7 @@
 #define HAVE_GETPAGESIZE 1
 
 /* Define to 1 if you have the `getrandom' function. */
-#define HAVE_GETRANDOM 1
+#undef HAVE_GETRANDOM
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
@@ -50,7 +50,7 @@
 #define HAVE_STRING_H 1
 
 /* Define to 1 if you have `syscall' and `SYS_getrandom'. */
-#define HAVE_SYSCALL_GETRANDOM 1
+#undef HAVE_SYSCALL_GETRANDOM
 
 /* Define to 1 if you have the <sys/param.h> header file. */
 #define HAVE_SYS_PARAM_H 1
@@ -118,7 +118,7 @@
 #define XML_DEV_URANDOM 1
 
 /* Define to make parameter entity parsing functionality available. */
-#define XML_DTD 1
+#undef XML_DTD
 
 /* Define to make XML Namespaces functionality available. */
 #define XML_NS 1

+ 2 - 0
libs/expat/lib/winconfig.h

@@ -41,5 +41,7 @@
 
 #include <memory.h>
 #include <string.h>
+#include <float.h>
+#define isnan _isnan
 
 #endif /* ndef WINCONFIG_H */

+ 6 - 0
libs/expat/lib/xmlparse.c

@@ -4375,6 +4375,7 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
   UNUSED_P(account);
 #endif
 
+  { // WINSCP
   /* save one level of indirection */
   DTD *const dtd = parser->m_dtd;
 
@@ -5348,6 +5349,7 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
       tok = XmlPrologTok(enc, s, end, &next);
     }
   }
+  } // WINSCP
   /* not reached */
 }
 
@@ -7970,9 +7972,11 @@ getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
   if (valueOrNull == NULL) {
     return defaultDebugLevel;
   }
+  { // WINSCP
   const char *const value = valueOrNull;
 
   errno = 0;
+  { // WINSCP
   char *afterValue = (char *)value;
   unsigned long debugLevel = strtoul(value, &afterValue, 10);
   if ((errno != 0) || (afterValue[0] != '\0')) {
@@ -7981,4 +7985,6 @@ getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
   }
 
   return debugLevel;
+  } // WINSCP
+  } // WINSCP
 }