![]() |
Delphi Compiler Direktive
Hallo,
Habe Frage zur bedingten Compilierung. Der folgende Code funktioniert nicht. Ich will "push rbx" anstelle von "push ebx" compilieren lassen, wenn "Windows 64" Modus aktiv ist. Zweite Frage ist {$DEFINE WIN64} überhaupt erforderlich oder ist das eine Compiler Variable? {$DEFINE WIN64} {$If WIN64} push rbx {$else} push ebx {$endif} Vielen Dank mwilms |
AW: Delphi Compiler Direktive
Hallo,
es müßte doch so heißen:
Delphi-Quellcode:
{$ifdef WIN64}
push rbx {$else} push ebx {$endif} |
AW: Delphi Compiler Direktive
Hallo!
Hier für Debug bzw. Release / 32 od. 64
Delphi-Quellcode:
begin
Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TForm1, Form1); {$IFDEF DEBUG} {$IFDEF WIN32} //Form1.Caption:= 'FM Hashtest Debug-X32'; //Application.Title:= 'FM Hashtest Debug-X32'; {$ENDIF WIN32} {$IFDEF WIN64} //Form1.Caption:= 'FM Hashtest Debug-X64'; //Application.Title:= 'FM Hashtest Debug-X64'; {$ENDIF WIN64} {$ENDIF DEBUG} {$IFDEF RELEASE} {$IFDEF WIN32} //Form1.Caption:= 'FM Hashtest - X32'; //Application.Title:= 'FM Hashtest - X32'; {$ENDIF WIN32} {$IFDEF WIN64} //Form1.Caption:= 'FM Hashtest - X64'; //Application.Title:= 'FM Hashtest - X64'; {$ENDIF WIN64} {$ENDIF RELEASE} Application.Run; end. |
AW: Delphi Compiler Direktive
Genau, da es ein DEFINE ist, muß es
Delphi-Quellcode:
heißen,
{$IFDEF...} {$ENDIF}
denn {$IF prüft eine Expression ("echte" Konstanten, sowie ein paar Compiler-Funktionen), also
Delphi-Quellcode:
, oder
{$IF Defined(WIN64)} {$IFEND}
Delphi-Quellcode:
const
aaa = 123; bbb = False; {$IF aaa = 456} {$IF (aaa = 123) and (CompilerVersion >= 21.0) and bbb} |
AW: Delphi Compiler Direktive
Vielen Dank! Es funktioniert mit "ifdef". WIN64 muss außerdem nicht definiert werden.
mwilms |
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:14 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz