Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile issue on Delphi 12 with ifndefs #12

Open
SkybuckFlying opened this issue Mar 12, 2024 · 1 comment
Open

Compile issue on Delphi 12 with ifndefs #12

SkybuckFlying opened this issue Mar 12, 2024 · 1 comment

Comments

@SkybuckFlying
Copy link

SkybuckFlying commented Mar 12, 2024

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)

@SkybuckFlying
Copy link
Author

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};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant