Browse Source

macOS build fix

Herman Schoenfeld 4 years ago
parent
commit
e14327b6ec

+ 15 - 15
src/core/UEPasa.pas

@@ -421,7 +421,7 @@ function TEPasa.ToString(AOmitExtendedChecksum: Boolean): String;
 var
   LPayloadContent: String;
 begin
-  Result := string.Empty;
+  Result := AnsiString.Empty;
   if PayloadType.HasTrait(ptNonDeterministic) then Exit;
 
   if (PayloadType.HasTrait(ptAddressedByName)) then begin
@@ -430,29 +430,29 @@ begin
     if (Not Account.HasValue) then Exit;
     Result := Result + Account.Value.ToString();
     if (AccountChecksum.HasValue) then begin
-      Result := Result + String.Format('-%u', [AccountChecksum.Value]);
+      Result := Result + AnsiString.Format('-%u', [AccountChecksum.Value]);
     end;
   end;
 
   if (PayloadType.HasTrait(ptAsciiFormatted)) then begin
-    LPayloadContent := String.Format('"%s"', [TPascalAsciiEncoding.Escape(Payload)]);
+    LPayloadContent := AnsiString.Format('"%s"', [TPascalAsciiEncoding.Escape(Payload)]);
   end else if (PayloadType.HasTrait(ptHexFormatted)) then begin
-    LPayloadContent := string.Format('0x%s', [Payload]);
+    LPayloadContent := AnsiString.Format('0x%s', [Payload]);
   end else if (PayloadType.HasTrait(ptBase58Formatted)) then begin
-    LPayloadContent := string.Format('%s', [Payload]);
+    LPayloadContent := AnsiString.Format('%s', [Payload]);
   end else begin
     // it is non-deterministic, so payload content is ignored
-    LPayloadContent := string.Empty;
+    LPayloadContent := AnsiString.Empty;
   end;
 
   if (PayloadType.HasTrait(ptPublic)) then begin
-    Result := Result + string.Format('[%s]', [LPayloadContent]);
+    Result := Result + AnsiString.Format('[%s]', [LPayloadContent]);
   end else if (PayloadType.HasTrait(ptRecipientKeyEncrypted)) then begin
-    Result := Result + string.Format('(%s)', [LPayloadContent]);
+    Result := Result + AnsiString.Format('(%s)', [LPayloadContent]);
   end else if (PayloadType.HasTrait(ptSenderKeyEncrypted)) then begin
-    Result := Result + string.Format('<%s>', [LPayloadContent]);
+    Result := Result + AnsiString.Format('<%s>', [LPayloadContent]);
   end else if (PayloadType.HasTrait(ptPasswordEncrypted)) then begin
-    Result := Result + string.Format('{%s:%s}', [LPayloadContent, TPascalAsciiEncoding.Escape(Password)]);
+    Result := Result + AnsiString.Format('{%s:%s}', [LPayloadContent, TPascalAsciiEncoding.Escape(Password)]);
   end else begin
     // it is non-deterministic, so payload omitted entirely
   end;
@@ -462,7 +462,7 @@ begin
       // Need to compute:
       ExtendedChecksum := TEPasaComp.ComputeExtendedChecksum(Result);
     end;
-    Result := Result + string.Format(':%s', [ExtendedChecksum]);
+    Result := Result + AnsiString.Format(':%s', [ExtendedChecksum]);
   end;
 end;
 
@@ -547,7 +547,7 @@ var
 begin
   AErrorCode := EPasaErrorCode.Success;
   AEPasa.Clear;
-  if (string.IsNullOrEmpty(AEPasaText)) then begin
+  if (AnsiString.IsNullOrEmpty(AEPasaText)) then begin
     AErrorCode := EPasaErrorCode.BadFormat;
     Exit(False);
   end;
@@ -581,7 +581,7 @@ begin
 
   if (LAccountName <> #0) then begin
     // Account Name
-    if (string.IsNullOrEmpty(LAccountName)) then begin
+    if (AnsiString.IsNullOrEmpty(LAccountName)) then begin
       AErrorCode := EPasaErrorCode.BadFormat;
       Exit(False);
     end;
@@ -673,7 +673,7 @@ begin
   // Payload
   if (LPayloadStartChar <> #0) then begin
     if (LPayloadContent = #0) then begin
-      AEPasa.Payload := string.Empty;
+      AEPasa.Payload := AnsiString.Empty;
     end else if (LPayloadContent.StartsWith('"')) then begin
       AEPasa.PayloadType := AEPasa.PayloadType + [ptAsciiFormatted] - [ptNonDeterministic];
       AEPasa.Payload := TPascalAsciiEncoding.UnEscape(LPayloadContent.Trim(['"']));
@@ -733,7 +733,7 @@ end;
 
 class function TEPasaComp.IsValidPayloadLength(APayloadType: TPayloadType; const APayloadContent: String): Boolean;
 begin
-  if (string.IsNullOrEmpty(APayloadContent)) then
+  if (AnsiString.IsNullOrEmpty(APayloadContent)) then
     Exit(True);
 
   if (APayloadType.HasTrait(ptPublic)) then begin

+ 3 - 3
src/core/UEncoding.pas

@@ -373,7 +373,7 @@ class function TPascalBase58Encoding.Encode(const ABytes: TArray<Byte>): String;
 Var
   LBN, LBNMod, LBNDiv: TBigNum;
 begin
-  Result := string.Empty;
+  Result := AnsiString.Empty;
   LBN := TBigNum.Create;
   LBNMod := TBigNum.Create;
   LBNDiv := TBigNum.Create(CharSet.Length);
@@ -468,7 +468,7 @@ var
   LPPtr: PChar;
   LPeek, LNext: Char;
 begin
-  Result := String.Empty;
+  Result := AnsiString.Empty;
   LPPtr := PChar(AStr);
 
   while LPPtr^ <> #0 do
@@ -525,7 +525,7 @@ var
   LPPtr: PChar;
   LPeek: Char;
 begin
-  Result := String.Empty;
+  Result := AnsiString.Empty;
   LPPtr := PChar(AStr);
 
   while LPPtr^ <> #0 do

+ 2 - 1
src/libraries/abstractmem/UAbstractBTree.pas

@@ -146,8 +146,9 @@ type
   End;
 
   TMemoryBTree<TData> = Class( TAbstractBTree<Integer,TData> )
+  private type TAbstractBTree__Integer_TData = TAbstractBTree<Integer,TData>;
   private
-    FBuffer : TList<TAbstractBTree<Integer,TData>.TAbstractBTreeNode> ;
+    FBuffer : TList<TAbstractBTree__Integer_TData.TAbstractBTreeNode>;    { needed for FPC bug }
     Froot : Integer;
     FDisposed : Integer;
     FDisposedMinPos : Integer;

+ 1 - 1
src/libraries/pascalcoin/UJSONFunctions.pas

@@ -894,7 +894,7 @@ end;
 
 Function TPCJSONObject.HasValue(const AParamName : String) : Boolean;
 begin
-  Result := HasName(AParamName) AND (NOT AsString(AParamName, String.Empty).IsEmpty);
+  Result := HasName(AParamName) AND (NOT AsString(AParamName, AnsiString.Empty).IsEmpty);
 end;
 
 

+ 11 - 0
src/pascalcoin_wallet_classic.dpr

@@ -37,6 +37,8 @@ uses
   UFRMDiagnosticTool in 'gui-classic\UFRMDiagnosticTool.pas' {FRMDiagnosticTool},
   UCommon in 'libraries\sphere10\UCommon.pas',
   UMemory in 'libraries\sphere10\UMemory.pas',
+  uregexpr in 'libraries\regex\uregexpr.pas',
+  regexpr_unicodedata in 'libraries\regex\regexpr_unicodedata.pas',
   UAccountKeyStorage in 'core\UAccountKeyStorage.pas',
   UAccounts in 'core\UAccounts.pas',
   UAES in 'core\UAES.pas',
@@ -59,6 +61,15 @@ uses
   {$IFDEF USE_ABSTRACTMEM}
   UPCAbstractMem in 'core\UPCAbstractMem.pas',
   UPCAbstractMemAccountKeys in 'core\UPCAbstractMemAccountKeys.pas',
+  UAbstractMem in 'libraries\abstractmem\UAbstractMem.pas',
+  UAbstractAVLTree in 'libraries\abstractmem\UAbstractAVLTree.pas',
+  UAbstractBTree in 'libraries\abstractmem\UAbstractBTree.pas',
+  UOrderedList in 'libraries\abstractmem\UOrderedList.pas',
+  UFileMem in 'libraries\abstractmem\UFileMem.pas',
+  UCacheMem in 'libraries\abstractmem\UCacheMem.pas',
+  UAbstractMemTList in 'libraries\abstractmem\UAbstractMemTList.pas',
+  UAbstractMemBTree in 'libraries\abstractmem\UAbstractMemBTree.pas',
+  UAVLCache in 'libraries\abstractmem\UAVLCache.pas',
   {$ENDIF}
   UPCAbstractMemAccounts in 'core\UPCAbstractMemAccounts.pas',
   UPCAccountsOrdenations in 'core\UPCAccountsOrdenations.pas',

+ 7 - 3
src/pascalcoin_wallet_classic.lpi

@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
   <ProjectOptions>
-    <Version Value="11"/>
+    <Version Value="12"/>
     <PathDelim Value="\"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <CompatibilityMode Value="True"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
-      <MainUnit Value="0"/>
       <Title Value="PascalCoin Wallet"/>
       <ResourceType Value="res"/>
       <Icon Value="0"/>
@@ -42,7 +42,7 @@
         <PackageName Value="LCL"/>
       </Item1>
     </RequiredPackages>
-    <Units Count="37">
+    <Units Count="38">
       <Unit0>
         <Filename Value="pascalcoin_wallet_classic.dpr"/>
         <IsPartOfProject Value="True"/>
@@ -222,6 +222,10 @@
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
       </Unit36>
+      <Unit37>
+        <Filename Value="core\UEPasa.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit37>
     </Units>
   </ProjectOptions>
   <CompilerOptions>