* contrib/hbexpat/3rd/expat/expat.diff
* contrib/hbexpat/3rd/expat/loadlibr.c
! use HB_WINAPI_GETPROCADDRESS() instead of GetProcAddress()
in WinCE builds
* contrib/hbhpdf/3rd/libhpdf/hpdfstre.c
* contrib/hbhpdf/3rd/libhpdf/libhpdf.diff
! include <windows.h> in WinCE builds, it's necessary for GetLastError()
* src/3rd/jpeg/Makefile
! do not use getenv() in all WinCE builds
* src/common/hbver.c
* cast revision number to HB_ULONG to pacify warning
* src/vm/extrap.c
! do not compile unused in WinCE builds hb_winExceptionHandler()
* include/hbapi.h
* added HB_EXPORT attribute to hb_macroTextValue() function
* include/hbvm.h
* src/vm/hvm.c
+ added C function:
PHB_ITEM hb_vmCompileMacro( const char * szExpr, PHB_ITEM pDest );
It returns Harbour item or NULL at error (wrong macro text).
The result should be used with hb_vmEvalBlockOrMacro() and then freed
by hb_vmDestroyBlockOrMacro(). It hides low level macro representation
so we can change it in the future. Now it's still simple pointer item
without autodestructor.
* src/rdd/hsx/hsx.c
* src/rdd/workarea.c
* use hb_vmCompileMacro() instead of hb_macroCompile()
* src/vm/runner.c
* changed 6101 error message for "Unknown or unregistered symbol"
to "Unknown or unregistered function symbol".
* report above error when HRB module is loaded and its external function
is not registered or not marked as DYNAMIC by earlier registered modules
in HVM symbol table.
Warning. This modification may exploit problems in code loading HRB files
with cross references which has worked so far. In such case user should
pass to hb_hrbLoad()/hb_hrbRun() as first parameters flags containing
HB_HRB_BIND_LAZY or declare the problematic function in his main code
as dynamic, i.e.:
DYNAMIC <funcName>
* src/rdd/dbf1.c
* declare internal function hb_dbfTransCheckCounters() as static one
* src/harbour.def
! added missing exported Harbour functions
204 lines
7.0 KiB
Diff
204 lines
7.0 KiB
Diff
diff --strip-trailing-cr -urN expat.orig/loadlibr.c expat/loadlibr.c
|
|
--- expat.orig/loadlibr.c 2024-02-13 06:16:03.142931679 +0100
|
|
+++ expat/loadlibr.c 2024-02-13 06:49:13.103221128 +0100
|
|
@@ -32,7 +32,10 @@
|
|
|
|
#if defined(_WIN32)
|
|
|
|
-#include <windows.h>
|
|
+#if defined(UNICODE) && !defined(_UNICODE)
|
|
+#define _UNICODE
|
|
+#endif
|
|
+#include "winconfi.h"
|
|
#include <tchar.h>
|
|
|
|
|
|
@@ -103,7 +106,7 @@
|
|
/* Detect if KB2533623 is installed, as LOAD_LIBARY_SEARCH_SYSTEM32 is only
|
|
supported on Windows Vista, Windows Server 2008, Windows 7 and Windows
|
|
Server 2008 R2 with this patch or natively on Windows 8 and above */
|
|
- else if(pLoadLibraryEx && GetProcAddress(hKernel32, "AddDllDirectory")) {
|
|
+ else if(pLoadLibraryEx && HB_WINAPI_GETPROCADDRESS(hKernel32, "AddDllDirectory")) {
|
|
/* Load the DLL from the Windows system directory */
|
|
hModule = pLoadLibraryEx(filename, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
|
}
|
|
@@ -114,7 +117,7 @@
|
|
/* Allocate space for the full DLL path (Room for the null terminator
|
|
is included in systemdirlen) */
|
|
size_t filenamelen = _tcslen(filename);
|
|
- TCHAR *path = malloc(sizeof(TCHAR) * (systemdirlen + 1 + filenamelen));
|
|
+ TCHAR *path = (TCHAR *) malloc(sizeof(TCHAR) * (systemdirlen + 1 + filenamelen));
|
|
if(path && GetSystemDirectory(path, systemdirlen)) {
|
|
/* Calculate the full DLL path */
|
|
_tcscpy(path + _tcslen(path), TEXT("\\"));
|
|
diff --strip-trailing-cr -urN expat.orig/winconfi.h expat/winconfi.h
|
|
--- expat.orig/winconfi.h 2024-02-13 06:16:03.142931679 +0100
|
|
+++ expat/winconfi.h 2017-12-20 11:37:33.337587069 +0100
|
|
@@ -1,63 +1 @@
|
|
-/*
|
|
- __ __ _
|
|
- ___\ \/ /_ __ __ _| |_
|
|
- / _ \\ /| '_ \ / _` | __|
|
|
- | __// \| |_) | (_| | |_
|
|
- \___/_/\_\ .__/ \__,_|\__|
|
|
- |_| XML parser
|
|
-
|
|
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
|
- Copyright (c) 2000-2017 Expat development team
|
|
- Licensed under the MIT license:
|
|
-
|
|
- Permission is hereby granted, free of charge, to any person obtaining
|
|
- a copy of this software and associated documentation files (the
|
|
- "Software"), to deal in the Software without restriction, including
|
|
- without limitation the rights to use, copy, modify, merge, publish,
|
|
- distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
- persons to whom the Software is furnished to do so, subject to the
|
|
- following conditions:
|
|
-
|
|
- The above copyright notice and this permission notice shall be included
|
|
- in all copies or substantial portions of the Software.
|
|
-
|
|
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
- USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
-*/
|
|
-
|
|
-#ifndef WINCONFIG_H
|
|
-#define WINCONFIG_H
|
|
-
|
|
-#define WIN32_LEAN_AND_MEAN
|
|
-#include <windows.h>
|
|
-#undef WIN32_LEAN_AND_MEAN
|
|
-
|
|
-#include <memory.h>
|
|
-#include <string.h>
|
|
-
|
|
-
|
|
-#if defined(HAVE_EXPAT_CONFIG_H) /* e.g. MinGW */
|
|
-# include <expat_config.h>
|
|
-#else /* !defined(HAVE_EXPAT_CONFIG_H) */
|
|
-
|
|
-
|
|
-#define XML_NS 1
|
|
-#define XML_DTD 1
|
|
-#define XML_CONTEXT_BYTES 1024
|
|
-
|
|
-/* we will assume all Windows platforms are little endian */
|
|
-#define BYTEORDER 1234
|
|
-
|
|
-/* Windows has memmove() available. */
|
|
-#define HAVE_MEMMOVE
|
|
-
|
|
-
|
|
-#endif /* !defined(HAVE_EXPAT_CONFIG_H) */
|
|
-
|
|
-
|
|
-#endif /* ndef WINCONFIG_H */
|
|
+#include "_hbconf.h"
|
|
diff --strip-trailing-cr -urN expat.orig/xmlparse.c expat/xmlparse.c
|
|
--- expat.orig/xmlparse.c 2024-02-13 06:16:03.142931679 +0100
|
|
+++ expat/xmlparse.c 2017-12-20 12:31:54.994032713 +0100
|
|
@@ -43,6 +43,12 @@
|
|
|
|
#ifdef _WIN32
|
|
#define getpid GetCurrentProcessId
|
|
+#elif defined(__WATCOMC__) && defined(__DOS__)
|
|
+#include <process.h> /* getpid() */
|
|
+#include <sys/timeb.h> /* ftime() */
|
|
+#elif defined(__WATCOMC__) && defined(__OS2__)
|
|
+#include <process.h> /* getpid() */
|
|
+#include <sys/time.h> /* gettimeofday() */
|
|
#else
|
|
#include <sys/time.h> /* gettimeofday() */
|
|
#include <sys/types.h> /* getpid() */
|
|
@@ -56,7 +62,7 @@
|
|
#ifdef _WIN32
|
|
#include "winconfi.h"
|
|
#elif defined(HAVE_EXPAT_CONFIG_H)
|
|
-#include <expat_config.h>
|
|
+#include <expat_co.h>
|
|
#endif /* ndef _WIN32 */
|
|
|
|
#include "ascii.h"
|
|
@@ -783,7 +789,7 @@
|
|
|
|
if (advapi32) {
|
|
const RTLGENRANDOM_FUNC RtlGenRandom
|
|
- = (RTLGENRANDOM_FUNC)GetProcAddress(advapi32, "SystemFunction036");
|
|
+ = (RTLGENRANDOM_FUNC)HB_WINAPI_GETPROCADDRESS(advapi32, "SystemFunction036");
|
|
if (RtlGenRandom) {
|
|
if (RtlGenRandom((PVOID)target, (ULONG)count) == TRUE) {
|
|
success = 1;
|
|
@@ -803,10 +809,21 @@
|
|
static unsigned long
|
|
gather_time_entropy(void)
|
|
{
|
|
-#ifdef _WIN32
|
|
+#ifdef _WINCE
|
|
+ SYSTEMTIME st;
|
|
+ GetSystemTime(&st);
|
|
+ return ( ( ( ( long ) st.wDay * 24 +
|
|
+ st.wHour ) * 60 +
|
|
+ st.wMinute ) * 60 +
|
|
+ st.wSecond ) * 1000 + st.wMilliseconds;
|
|
+#elif defined(_WIN32)
|
|
FILETIME ft;
|
|
GetSystemTimeAsFileTime(&ft); /* never fails */
|
|
return ft.dwHighDateTime ^ ft.dwLowDateTime;
|
|
+#elif defined(__WATCOMC__) && defined(__DOS__)
|
|
+ struct timeb tb;
|
|
+ ftime( &tb );
|
|
+ return tb.time ^ tb.millitm;
|
|
#else
|
|
struct timeval tv;
|
|
int gettimeofday_res;
|
|
@@ -829,7 +846,11 @@
|
|
|
|
static unsigned long
|
|
ENTROPY_DEBUG(const char * label, unsigned long entropy) {
|
|
+#ifdef _WINCE
|
|
+ const char * const EXPAT_ENTROPY_DEBUG = NULL;
|
|
+#else
|
|
const char * const EXPAT_ENTROPY_DEBUG = getenv("EXPAT_ENTROPY_DEBUG");
|
|
+#endif
|
|
if (EXPAT_ENTROPY_DEBUG && ! strcmp(EXPAT_ENTROPY_DEBUG, "1")) {
|
|
fprintf(stderr, "Entropy: %s --> 0x%0*lx (%lu bytes)\n",
|
|
label,
|
|
@@ -7186,7 +7207,7 @@
|
|
charsRequired++;
|
|
|
|
/* Now allocate space for the copy */
|
|
- result = memsuite->malloc_fcn(charsRequired * sizeof(XML_Char));
|
|
+ result = (XML_Char *) memsuite->malloc_fcn(charsRequired * sizeof(XML_Char));
|
|
if (result == NULL)
|
|
return NULL;
|
|
/* Copy the original into place */
|
|
diff --strip-trailing-cr -urN expat.orig/xmlrole.c expat/xmlrole.c
|
|
--- expat.orig/xmlrole.c 2024-02-13 06:16:03.142931679 +0100
|
|
+++ expat/xmlrole.c 2017-12-20 11:37:33.337587069 +0100
|
|
@@ -36,7 +36,7 @@
|
|
#include "winconfi.h"
|
|
#else
|
|
#ifdef HAVE_EXPAT_CONFIG_H
|
|
-#include <expat_config.h>
|
|
+#include <expat_co.h>
|
|
#endif
|
|
#endif /* ndef _WIN32 */
|
|
|
|
diff --strip-trailing-cr -urN expat.orig/xmltok.c expat/xmltok.c
|
|
--- expat.orig/xmltok.c 2024-02-13 06:16:03.142931679 +0100
|
|
+++ expat/xmltok.c 2018-09-20 12:45:24.874163719 +0200
|
|
@@ -47,7 +47,7 @@
|
|
#include "winconfi.h"
|
|
#else
|
|
#ifdef HAVE_EXPAT_CONFIG_H
|
|
-#include <expat_config.h>
|
|
+#include <expat_co.h>
|
|
#endif
|
|
#endif /* ndef _WIN32 */
|
|
|