Skip to content

Commit

Permalink
2017-06-25 16:17 UTC Viktor Szakats (vszakats users.noreply.github.com)
Browse files Browse the repository at this point in the history
  * contrib/hbexpat/3rd/expat/expat.hbp
  * contrib/hbexpat/3rd/expat/expat.dif
  * contrib/hbexpat/3rd/expat/*
    * expat 2.2.1 (from 2.2.0)
  • Loading branch information
vszakats committed Jun 25, 2017
1 parent bc2162f commit cc5efa5
Show file tree
Hide file tree
Showing 9 changed files with 548 additions and 200 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */

2017-06-25 16:17 UTC Viktor Szakats (vszakats users.noreply.github.com)
* contrib/hbexpat/3rd/expat/expat.hbp
* contrib/hbexpat/3rd/expat/expat.dif
* contrib/hbexpat/3rd/expat/*
* expat 2.2.1 (from 2.2.0)

2017-06-15 11:00 UTC Viktor Szakats (vszakats users.noreply.github.com)
* config/hbpost.hbm
* make sure to install license/readme files that have no
Expand Down
2 changes: 1 addition & 1 deletion contrib/hbexpat/3rd/expat/COPYING
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
Copyright (c) 2001-2016 Expat maintainers
Copyright (c) 2001-2017 Expat maintainers

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
54 changes: 19 additions & 35 deletions contrib/hbexpat/3rd/expat/expat.diff
Original file line number Diff line number Diff line change
@@ -1,58 +1,42 @@
diff --strip-trailing-cr -urN expat.orig/xmlparse.c expat/xmlparse.c
--- expat.orig/xmlparse.c 2016-06-21 12:58:38.000000000 +0000
+++ expat/xmlparse.c 2017-05-26 05:20:42.000000000 +0000
@@ -17,7 +17,9 @@
--- expat.orig/xmlparse.c 2017-06-17 16:07:38.000000000 +0000
+++ expat/xmlparse.c 2017-06-25 16:17:09.000000000 +0000
@@ -23,7 +23,9 @@

#define XML_BUILDING_EXPAT 1

-#ifdef WIN32
-#ifdef _WIN32
+#ifdef HARBOUR_CONF
+#include "_hbconf.h"
+#elif defined(WIN32)
+#elif defined(_WIN32)
#include "winconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
@@ -722,7 +724,14 @@
/* Process ID is 0 bits entropy if attacker has local access
* XML_Parser address is few bits of entropy if attacker has local access */
const unsigned long entropy =
- gather_time_entropy() ^ getpid() ^ (unsigned long)parser;
+ gather_time_entropy() ^ getpid() ^
+#if defined( _WIN64 ) && defined( __GNUC__ )
+ (unsigned long)(unsigned long long)parser;
+#elif defined( _WIN64 )
+ (unsigned long)(unsigned __int64)parser;
+#else
+ (unsigned long)parser;
+#endif

/* Factors are 2^31-1 and 2^61-1 (Mersenne primes M31 and M61) */
if (sizeof(unsigned long) == 4) {
#elif defined(HAVE_EXPAT_CONFIG_H)
#include <expat_config.h>
diff --strip-trailing-cr -urN expat.orig/xmlrole.c expat/xmlrole.c
--- expat.orig/xmlrole.c 2016-06-21 12:58:38.000000000 +0000
+++ expat/xmlrole.c 2017-05-26 05:20:54.000000000 +0000
--- expat.orig/xmlrole.c 2017-06-17 16:07:38.000000000 +0000
+++ expat/xmlrole.c 2017-06-25 16:17:09.000000000 +0000
@@ -4,7 +4,9 @@

#include <stddef.h>

-#ifdef WIN32
-#ifdef _WIN32
+#ifdef HARBOUR_CONF
+#include "_hbconf.h"
+#elif defined(WIN32)
+#elif defined(_WIN32)
#include "winconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
#else
#ifdef HAVE_EXPAT_CONFIG_H
diff --strip-trailing-cr -urN expat.orig/xmltok.c expat/xmltok.c
--- expat.orig/xmltok.c 2016-06-21 12:58:38.000000000 +0000
+++ expat/xmltok.c 2017-05-26 05:21:01.000000000 +0000
--- expat.orig/xmltok.c 2017-06-17 16:07:38.000000000 +0000
+++ expat/xmltok.c 2017-06-25 16:17:09.000000000 +0000
@@ -4,7 +4,9 @@

#include <stddef.h>

-#ifdef WIN32
-#ifdef _WIN32
+#ifdef HARBOUR_CONF
+#include "_hbconf.h"
+#elif defined(WIN32)
+#elif defined(_WIN32)
#include "winconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
#else
#ifdef HAVE_EXPAT_CONFIG_H
22 changes: 16 additions & 6 deletions contrib/hbexpat/3rd/expat/expat.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ enum XML_Error {
/* Added in 2.0. */
XML_ERROR_RESERVED_PREFIX_XML,
XML_ERROR_RESERVED_PREFIX_XMLNS,
XML_ERROR_RESERVED_NAMESPACE_URI
XML_ERROR_RESERVED_NAMESPACE_URI,
/* Added in 2.2.1. */
XML_ERROR_INVALID_ARGUMENT
};

enum XML_Content_Type {
Expand Down Expand Up @@ -706,6 +708,7 @@ XML_UseParserAsHandlerArg(XML_Parser parser);
be called, despite an external subset being parsed.
Note: If XML_DTD is not defined when Expat is compiled, returns
XML_ERROR_FEATURE_REQUIRES_XML_DTD.
Note: If parser == NULL, returns XML_ERROR_INVALID_ARGUMENT.
*/
XMLPARSEAPI(enum XML_Error)
XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
Expand All @@ -729,15 +732,16 @@ XML_GetBase(XML_Parser parser);
to the XML_StartElementHandler that were specified in the start-tag
rather than defaulted. Each attribute/value pair counts as 2; thus
this correspondds to an index into the atts array passed to the
XML_StartElementHandler.
XML_StartElementHandler. Returns -1 if parser == NULL.
*/
XMLPARSEAPI(int)
XML_GetSpecifiedAttributeCount(XML_Parser parser);

/* Returns the index of the ID attribute passed in the last call to
XML_StartElementHandler, or -1 if there is no ID attribute. Each
attribute/value pair counts as 2; thus this correspondds to an
index into the atts array passed to the XML_StartElementHandler.
XML_StartElementHandler, or -1 if there is no ID attribute or
parser == NULL. Each attribute/value pair counts as 2; thus this
correspondds to an index into the atts array passed to the
XML_StartElementHandler.
*/
XMLPARSEAPI(int)
XML_GetIdAttributeIndex(XML_Parser parser);
Expand Down Expand Up @@ -901,6 +905,7 @@ enum XML_ParamEntityParsing {
entities is requested; otherwise it will return non-zero.
Note: If XML_SetParamEntityParsing is called after XML_Parse or
XML_ParseBuffer, then it has no effect and will always return 0.
Note: If parser == NULL, the function will do nothing and return 0.
*/
XMLPARSEAPI(int)
XML_SetParamEntityParsing(XML_Parser parser,
Expand All @@ -910,6 +915,7 @@ XML_SetParamEntityParsing(XML_Parser parser,
Helps in preventing DoS attacks based on predicting hash
function behavior. This must be called before parsing is started.
Returns 1 if successful, 0 when called after parsing has started.
Note: If parser == NULL, the function will do nothing and return 0.
*/
XMLPARSEAPI(int)
XML_SetHashSalt(XML_Parser parser,
Expand All @@ -936,6 +942,10 @@ XML_GetErrorCode(XML_Parser parser);
the location is the location of the character at which the error
was detected; otherwise the location is the location of the last
parse event, as described above.
Note: XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber
return 0 to indicate an error.
Note: XML_GetCurrentByteIndex returns -1 to indicate an error.
*/
XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser);
XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser);
Expand Down Expand Up @@ -1039,7 +1049,7 @@ XML_GetFeatureList(void);
*/
#define XML_MAJOR_VERSION 2
#define XML_MINOR_VERSION 2
#define XML_MICRO_VERSION 0
#define XML_MICRO_VERSION 1

#ifdef __cplusplus
}
Expand Down
3 changes: 1 addition & 2 deletions contrib/hbexpat/3rd/expat/expat.hbp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ xmlrole.c
xmltok.c

-cflag=-DHARBOUR_CONF
{win}-cflag=-DWIN32
{hblib}-cflag=-DXML_STATIC
{bcc}-cflag=-w-8057
{bcc}-cflag=-w-8008
{bcc}-cflag=-w-8066

# ORIGIN https://github.com/libexpat/libexpat
# URL https://downloads.sourceforge.net/project/expat/expat/2.2.0/expat-2.2.0.tar.bz2
# URL https://downloads.sourceforge.net/project/expat/expat/2.2.1/expat-2.2.1.tar.bz2
# DIFF expat.diff
#
# MAP COPYING
Expand Down
5 changes: 4 additions & 1 deletion contrib/hbexpat/3rd/expat/expat_external.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ extern "C" {
#endif

#ifdef XML_UNICODE_WCHAR_T
#define XML_UNICODE
# define XML_UNICODE
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
# endif
#endif

#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
Expand Down
Loading

0 comments on commit cc5efa5

Please sign in to comment.