64 bits Compatibility
Moderators: gto, cipto_kh, EgonHugeist, mdaems
64 bits Compatibility
To be 64 bits compatible here is the code :
In ZDbcCache :
TZRowBuffer = packed record
Index: SizeInt;
UpdateType: TZRowUpdateType;
BookmarkFlag: Byte;
Columns: TByteArray;
end;
In ZAbstractRODataset :
Index of TZRowBuffer must be 64 bits compliant
Setting Index forcing the integer to be SizeInt
Like this
.Index := SizeInt ( RowNo );
In ZAbstractRODataset Always :
Another part wich is good like this :
if not (State in [dsCalcFields, dsFilter, dsNewValue]) then
DataEvent(deFieldChange, PtrInt(Field));
In ZDbcCache :
TZRowBuffer = packed record
Index: SizeInt;
UpdateType: TZRowUpdateType;
BookmarkFlag: Byte;
Columns: TByteArray;
end;
In ZAbstractRODataset :
Index of TZRowBuffer must be 64 bits compliant
Setting Index forcing the integer to be SizeInt
Like this
.Index := SizeInt ( RowNo );
In ZAbstractRODataset Always :
Another part wich is good like this :
if not (State in [dsCalcFields, dsFilter, dsNewValue]) then
DataEvent(deFieldChange, PtrInt(Field));
Re: 64 bits Compatibility
This changes as patch for Zeos 6.6.6matthius wrote:To be 64 bits compatible here is the code :
...
You do not have the required permissions to view the files attached to this post.
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Seems like this SizeInt and PtrInt are FPC datatypes which are equal to LongInt. At least on my 32 bit machine.
W8... checked in my 64 bit vm. There they both refer to Integer (which equals LongInt on 32 bit, isn't it?)
Can you test again by replacing All sizeint by Integer in your version?
I did this in my 32 bit machine and that doesn't seem to break the test suite.
Does it also fix 64 bit problems?
Mark
W8... checked in my 64 bit vm. There they both refer to Integer (which equals LongInt on 32 bit, isn't it?)
Can you test again by replacing All sizeint by Integer in your version?
I did this in my 32 bit machine and that doesn't seem to break the test suite.
Does it also fix 64 bit problems?
Mark
Yes. In principle that is true.
There are also U variants (SizeUint, ptrUint) for unsigned variants, equal to cardinal and qword on resp 32bit and 64-bit
ptr(u)int should be large enough to contain a pointer. (long or longlong in posix lingo)
size(u)int should be large enough to contain the difference between any two pointers. size_t in POSIX jargon.
There are also U variants (SizeUint, ptrUint) for unsigned variants, equal to cardinal and qword on resp 32bit and 64-bit
ptr(u)int should be large enough to contain a pointer. (long or longlong in posix lingo)
size(u)int should be large enough to contain the difference between any two pointers. size_t in POSIX jargon.
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
marcov,
Does this mean the solution I proposed 3 posts above this one is allright?
Or should I add to ZCompatibility.pas
Mark
Does this mean the solution I proposed 3 posts above this one is allright?
Or should I add
Code: Select all
%u7b$ifndef FPC%u7d
SizeInt = Longint;
PtrInt = Longint;
%u7b$endif%u7d
Mark