Explorar o código

* Forgot to commit

git-svn-id: trunk@43362 -
michael %!s(int64=5) %!d(string=hai) anos
pai
achega
bd91c559ee
Modificáronse 2 ficheiros con 46 adicións e 7 borrados
  1. 33 6
      packages/libxml/src/globals.inc
  2. 13 1
      packages/libxml/src/xmlmemory.inc

+ 33 - 6
packages/libxml/src/globals.inc

@@ -155,12 +155,39 @@ var
 {$ENDIF}
 
 {$ELSE} (* !LIBXML_THREAD_ALLOC_ENABLED *)
-var
-  xmlMalloc: xmlMallocFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
-  xmlMallocAtomic: xmlMallocFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
-  xmlRealloc: xmlReallocFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
-  xmlFree: xmlFreeFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
-  xmlMemStrdup: xmlStrdupFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
+{$IFDEF NO_EXTERNAL_VARS}
+var
+  varxmlMalloc: PxmlMallocFunc;
+  varxmlMallocAtomic: PxmlMallocFunc;
+  varxmlRealloc: PxmlReallocFunc;
+  varxmlFree: PxmlFreeFunc;
+  varxmlMemStrdup: PxmlStrdupFunc;
+
+function GetxmlMalloc: xmlMallocFunc; inline;
+procedure SetxmlMalloc(AValue: xmlMallocFunc); inline;
+function GetxmlMallocAtomic: xmlMallocFunc; inline;
+procedure SetxmlMallocAtomic(AValue: xmlMallocFunc); inline;
+function GetxmlRealloc: xmlReallocFunc; inline;
+procedure SetxmlRealloc(AValue: xmlReallocFunc); inline;
+function GetxmlFree: xmlFreeFunc; inline;
+procedure SetxmlFree(AValue: xmlFreeFunc); inline;
+function GetxmlMemStrdup: xmlStrdupFunc; inline;
+procedure SetxmlMemStrdup(AValue: xmlStrdupFunc); inline;
+
+property xmlMalloc: xmlMallocFunc read GetxmlMalloc write SetxmlMalloc;
+property xmlMallocAtomic: xmlMallocFunc read GetxmlMallocAtomic write SetxmlMallocAtomic;
+property xmlRealloc: xmlReallocFunc read GetxmlRealloc write SetxmlRealloc;
+property xmlFree: xmlFreeFunc read GetxmlFree write SetxmlFree;
+property xmlMemStrdup: xmlStrdupFunc read GetxmlMemStrdup write SetxmlMemStrdup;
+
+{$ELSE}
+var
+  xmlMalloc: xmlMallocFunc; cvar; external;
+  xmlMallocAtomic: xmlMallocFunc; cvar; external;
+  xmlRealloc: xmlReallocFunc; cvar; external;
+  xmlFree: xmlFreeFunc; cvar; external;
+  xmlMemStrdup: xmlStrdupFunc; cvar; external;
+{$ENDIF}
 {$ENDIF} (* LIBXML_THREAD_ALLOC_ENABLED *)
 
 {$IFDEF LIBXML_DOCB_ENABLED}

+ 13 - 1
packages/libxml/src/xmlmemory.inc

@@ -45,6 +45,9 @@
  * Signature for a free() implementation.
  *)
   xmlFreeFunc = procedure(mem: pointer); EXTDECL;
+  {$IFDEF NO_EXTERNAL_VARS}
+  PxmlFreeFunc = ^xmlFreeFunc;
+  {$ENDIF}
 
 (**
  * xmlMallocFunc:
@@ -55,6 +58,9 @@
  * Returns a pointer to the newly allocated block or NULL in case of error.
  *)
   xmlMallocFunc = function(size: csize_t): pointer; EXTDECL;
+  {$IFDEF NO_EXTERNAL_VARS}
+  PxmlMallocFunc = ^xmlMallocFunc;
+  {$ENDIF}
 
 (**
  * xmlReallocFunc:
@@ -66,6 +72,9 @@
  * Returns a pointer to the newly reallocated block or NULL in case of error.
  *)
   xmlReallocFunc = function(mem: pointer; size: csize_t): pointer; EXTDECL;
+  {$IFDEF NO_EXTERNAL_VARS}
+  PxmlReallocFunc = ^xmlReallocFunc;
+  {$ENDIF}
 
 (**
  * xmlStrdupFunc:
@@ -76,6 +85,9 @@
  * Returns the copy of the string or NULL in case of error.
  *)
   xmlStrdupFunc = function(str: pchar): pchar; EXTDECL;
+  {$IFDEF NO_EXTERNAL_VARS}
+  PxmlStrdupFunc = ^xmlStrdupFunc;
+  {$ENDIF}
 
 (*
  * The 4 interfaces used for all memory handling within libxml.
@@ -170,4 +182,4 @@ function xmlMemStrdupLoc(str: pchar; _file: pchar; line: cint): pchar; EXTDECL;
 //#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__)
 
 {$ENDIF} (* DEBUG_MEMORY_LOCATION *)
-{$ENDIF}
+{$ENDIF}