Browse Source

* fixes cmem.malloc et al. for windows as proposed by Ludo Brands, resolves #15571

git-svn-id: trunk@18256 -
florian 14 years ago
parent
commit
41f25c2b21
3 changed files with 10 additions and 4 deletions
  1. 1 0
      .gitattributes
  2. 4 4
      rtl/inc/cmem.pp
  3. 5 0
      tests/webtbs/tw15571.pp

+ 1 - 0
.gitattributes

@@ -11515,6 +11515,7 @@ tests/webtbs/tw15467.pp svneol=native#text/pascal
 tests/webtbs/tw15500.pp svneol=native#text/plain
 tests/webtbs/tw15504.pp svneol=native#text/plain
 tests/webtbs/tw15530.pp svneol=native#text/pascal
+tests/webtbs/tw15571.pp svneol=native#text/pascal
 tests/webtbs/tw15591.pp svneol=native#text/pascal
 tests/webtbs/tw15592.pp svneol=native#text/plain
 tests/webtbs/tw15599.pp svneol=native#text/plain

+ 4 - 4
rtl/inc/cmem.pp

@@ -48,10 +48,10 @@ Procedure free (P : pointer); cdecl; external;
 function realloc (P : Pointer; Size : ptruint) : pointer;cdecl; external;
 Function calloc (unitSize,UnitCount : ptruint) : pointer;cdecl; external;
 {$else not USE_STATIC_LIBC}
-Function Malloc (Size : ptruint) : Pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'malloc';
-Procedure Free (P : pointer); {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'free';
-function ReAlloc (P : Pointer; Size : ptruint) : pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'realloc';
-Function CAlloc (unitSize,UnitCount : ptruint) : pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'calloc';
+Function Malloc (Size : ptruint) : Pointer; cdecl; external LibName name 'malloc';
+Procedure Free (P : pointer); cdecl; external LibName name 'free';
+function ReAlloc (P : Pointer; Size : ptruint) : pointer; cdecl; external LibName name 'realloc';
+Function CAlloc (unitSize,UnitCount : ptruint) : pointer; cdecl; external LibName name 'calloc';
 {$endif not USE_STATIC_LIBC}
 
 implementation

+ 5 - 0
tests/webtbs/tw15571.pp

@@ -0,0 +1,5 @@
+uses cmem, sysutils;
+begin
+ inttostr(1234);
+ malloc(1000); //crashes here
+end.