Giter VIP home page Giter VIP logo

cryptobboxvcl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryptobboxvcl's Issues

Update for Delphi 10.2 Tokyo

To use this library with Delphi 10.2 and later, three procedures in SBUtils.pas need to be modified. I've chosen to overload them for not touching the original code.

// Addition for DX 10.2
// "Given that dynamic arrays are managed types, involving reference counting 
// and associated helper function generation, casting array elements using 
// the @ operator is disallowed as it leads to memory corruption. Performing a 
// similar operation is still allowed using an explicit cast operation, under the 
// developer responsibility."
// http://docwiki.embarcadero.com/RADStudio/Tokyo/en/What%27s_New
procedure PointerToLInt(var B : PLInt; const P : Pointer; Size : integer);
begin
  PointerToLInt(B, ByteArray(P), Size);
end;

procedure LIntToPointer(B: PLInt; P: Pointer; var Size: LongInt);
begin
  LIntToPointer(B, ByteArray(P), Size);
end;

procedure SBMove(Src: ByteArray; SrcOffset: Integer; Dst: Pointer; DstOffset: Integer; Size: Integer);
begin
  SBMove(Src, SrcOffset, ByteArray(Dst), DstOffset, Size);
end;

And of course:

procedure PointerToLInt(var B : PLInt; const P : Pointer; Size : integer); overload;
procedure LIntToPointer(B: PLInt; P: Pointer; var Size: LongInt); overload;
procedure SBMove(Src: ByteArray; SrcOffset: Integer; Dst: Pointer; DstOffset: Integer; Size: Integer); overload;

For not having to modify the project compiler settings in every project where you use this library, I would recommend to add these three lines at the top of SecBbox.inc:

{$define SB_UNICODE_VCL}
{$define SB_NO_BYTEARRAY_CONST_ARRAYS}
{$define SB_PASCAL_STRINGS}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.