DelphiOTP
DelphiOTP copied to clipboard
Compile issue on Delphi 12 with ifndefs
Problem with last line:
{###############################################################################
https://github.com/wendelb/DelphiOTP
###############################################################################}
unit GoogleOTP;
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$ENDIF}
interface
uses
{$IFNDEF FPC}System.{$ENDIF}SysUtils, {$IFNDEF FPC}System.{$ENDIF}Math, Base32U, {$IFNDEF FPC}System.{$ENDIF}DateUtils
{$IFNDEF FPC}
[dcc32 Error] GoogleOTP.pas(13): E2029 Identifier expected but end of file found [dcc32 Error] GoogleOTP.pas(13): E2029 Identifier expected but end of file found [dcc32 Error] Base32U.pas(22): E2029 Identifier expected but end of file found [dcc32 Error] Base32U.pas(55): E2003 Undeclared identifier: 'UpperCase' [dcc32 Fatal Error] GoogleOTP.pas(13): F2063 Could not compile used unit 'Base32U.pas'
I will try to fix it myself but first I or copilot must understand what the problem is, it's kinda weird ! ;) =D
(Thanks btw for writing a small little app, saves me some time, I hope it's compatible with winotp and google authenticator ! ;) then I can compile/build this and hopefully this app will then work on windows 7, unlike all the other crap out there ! =D)
Fixed it for you:
uses
(*
{$IFNDEF FPC}System.{$ENDIF}SysUtils, {$IFNDEF FPC}System.{$ENDIF}Math, Base32U, {$IFNDEF FPC}System.{$ENDIF}DateUtils
{$IFNDEF FPC}
, IdGlobal, IdHMACSHA1
{$ELSE}
, HMAC
{$IFEND};
*)
Base32U,
{$IFDEF FPC}
SysUtils,
Math,
DateUtils
{$ELSE}
System.SysUtils,
System.Math,
System.DateUtils,
{$IFEND}
{$IFNDEF FPC}
IdGlobal,
IdHMACSHA1
{$ELSE}
, HMAC
{$IFEND};