Hello all

Hello all,
I made a port of "HashLib" (http://hashlib.codeplex.com/) "with some fixes, additions and modifications" for Delphi (2010 ( I hope ) and above) and FPC (3.0.0 and above) and I need help with some compilation testing for Delphi since I only have access to Delphi XE4 Up 1 and 10 Seattle.
I will appreciate it if some members here can help me check if it compiles in at least Delphi 2010 to XE3.
This is to enable me know what "framework" to use for my Unit Tests.

Here is how to compile the packages.

For Delphi users:
The packages are in Packages\Delphi.

To build the package in Delphi (the next procedure is for Delphi 10 Seattle; it may slightly differ for other versions):
Find the full path to the HashLib folder (depends on where you unpacked the downloaded archive or repo)
Open Project Options dialog for the package, set Build Configuration to All Configurations and replace the search path to HashLib by your actual path
Open Project Manager and build a package in Debug and Release configurations
To enable Ctrl-click navigation in the editor open Tools->Options.. dialog, select Delphi options->Library and add paths to the source code units of the package to the Browsing path.
To make the package available to an application open the application’s Project Options dialog, set Build Configuration to All Configurations and add the next path to Search path: $(BDSCOMMONDIR)\HashLib4Pascal\$(Config)\$(Platform).

For Lazarus/FPC users:
The packages are in Packages\FPC.

For FPC (3.0.0 and above)
To build the package in Lazarus

Method 1
Open a package (it requires opening any project first, or creating a dummy project)
The packages are configured with the unit output directory C:\bin\FPC\HashLib4Pascal\$(TargetCPU)-$(TargetOS)
Click Compile button
To make the package available to an application open the application’s Project Options dialog, click Compiler Options > Paths and add the next path to Other unit files -(Fu): C:\bin\FPC\HashLib4Pascal\$(TargetCPU)$(TargetOS)

Method 2

Add the Package to an Existing Project as a "Required Package" through the project inspector and Build.

TO DO

** Add Comprehensive Unit Tests.
** Add Documentation on how to Use.

Your Feedbacks are needed.
Thanks in Advance.

https://github.com/Xor-el/HashLib4Pascal
https://github.com/Xor-el/HashLib4Pascal

Comments

  1. Alexander Elagin ,  I have committed a patch to fix the issue with Delphi 2010 in relation to Generics.
    could you help me check if it compiles successfully in Delphi 2010?
    Thanks.

    ReplyDelete
  2. Ugochukwu Mmaduekwe  OK, here it goes... Finally without errors and warnings :-)
    To successfully build the library in D2010, I've made the following patches:
    1) In HashLib.inc, inserted at line 35:
    {$if CompilerVersion >= 22.0}
    {$define DELPHIXE_UP}
    {$ifend}
    2) In uHashLibTypes.pas at line 44 replaced
    {$IFDEF DELPHI2010_UP}
    with
    {$IFDEF DELPHIXE_UP}
    because of multiple errors caused by TArray<> incompatibility with array of
    3) In uMD4.pas, uMD5.pas, uRIPEMD.pas, uuRIPEMD128.pas, uRIPEMD160.pas, uRIPEMD256.pas, uRIPEMD320.pas added SysUtils to the uses clause to get rid of the 'not inlined' hint.

    Now everything builds successfully:
    Checking project dependencies...
    Building HashLib4PascalPackage.dproj (Debug configuration)
    Success
    Elapsed time: 00:00:01.2

    Of course, I have not tested the real functionality, but at least now you have the compilable code base. Congratulations!

    ReplyDelete
  3. Alexander Elagin , Thanks for your feedback.
    I have made a commit based on your feedback and now HashLib4Pascal should compile properly in Delphi 2010 without warnings or hints.
    Thanks once again.

    ReplyDelete

Post a Comment