-
-
Notifications
You must be signed in to change notification settings - Fork 142
chore(windows): Delphi 11/12 source compatibility #16043
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
base: master
Are you sure you want to change the base?
Changes from 10 commits
ebc6d2a
a57500f
b611e81
d7b3784
9d53e77
736afd9
9ef5278
d69d9b7
4d09020
fc69786
7ebe611
1c32b23
e363227
90792cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -937,11 +937,15 @@ function TJclCriticalSectionEx.TryEnter: Boolean; | |
|
|
||
| //== { TJclEvent } =========================================================== | ||
|
|
||
| // Keyman local patch: Delphi 11/12 compat (vendored JCL). Explicit BOOL() casts | ||
| // added below to satisfy Delphi 12's stricter implicit-Boolean->BOOL conversion. | ||
| // Backwards-compatible with Delphi 10.3 (BOOL is an ordinal-preserving typecast). | ||
| // On JCL refresh from upstream: re-apply if upstream hasn't picked up the cast. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this more deeply. This seems to be total nonsense! I even took the time to try building with an unmodified JclSynch.pas to verify this -- it is completely unnecessary.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair — reverted in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right that a lot of the compile chain doesn't need this patch — but TIKE does. Reapplied in I'd initially reverted the whole JclSynch patch on your feedback and only rediscovered the need when running a fresh TIKE build for the CE workflow verification. Apologies for the churn — the empirical test you asked for was correct methodology, just needed the fuller project set to surface the failure.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| constructor TJclEvent.Create(SecAttr: PSecurityAttributes; Manual, Signaled: Boolean; const Name: string); | ||
| begin | ||
| inherited Create; | ||
| FName := Name; | ||
| FHandle := {$IFDEF HAS_UNITSCOPE}Winapi.{$ENDIF}Windows.CreateEvent(SecAttr, Manual, Signaled, PChar(FName)); | ||
| FHandle := {$IFDEF HAS_UNITSCOPE}Winapi.{$ENDIF}Windows.CreateEvent(SecAttr, BOOL(Manual), BOOL(Signaled), PChar(FName)); | ||
| if FHandle = 0 then | ||
| raise EJclEventError.CreateRes(@RsSynchCreateEvent); | ||
| FExisted := GetLastError = ERROR_ALREADY_EXISTS; | ||
|
|
@@ -952,7 +956,7 @@ constructor TJclEvent.Open(Access: Cardinal; Inheritable: Boolean; | |
| begin | ||
| FName := Name; | ||
| FExisted := True; | ||
| FHandle := {$IFDEF HAS_UNITSCOPE}Winapi.{$ENDIF}Windows.OpenEvent(Access, Inheritable, PChar(Name)); | ||
| FHandle := {$IFDEF HAS_UNITSCOPE}Winapi.{$ENDIF}Windows.OpenEvent(Access, BOOL(Inheritable), PChar(Name)); | ||
| if FHandle = 0 then | ||
| raise EJclEventError.CreateRes(@RsSynchOpenEvent); | ||
| end; | ||
|
|
@@ -980,7 +984,7 @@ constructor TJclWaitableTimer.Create(SecAttr: PSecurityAttributes; | |
| begin | ||
| FName := Name; | ||
| FResume := False; | ||
| FHandle := CreateWaitableTimer(SecAttr, Manual, PChar(Name)); | ||
| FHandle := CreateWaitableTimer(SecAttr, BOOL(Manual), PChar(Name)); | ||
| if FHandle = 0 then | ||
| raise EJclWaitableTimerError.CreateRes(@RsSynchCreateWaitableTimer); | ||
| FExisted := GetLastError = ERROR_ALREADY_EXISTS; | ||
|
|
@@ -1000,7 +1004,7 @@ constructor TJclWaitableTimer.Open(Access: Cardinal; Inheritable: Boolean; | |
| FExisted := True; | ||
| FName := Name; | ||
| FResume := False; | ||
| FHandle := OpenWaitableTimer(Access, Inheritable, PChar(Name)); | ||
| FHandle := OpenWaitableTimer(Access, BOOL(Inheritable), PChar(Name)); | ||
| if FHandle = 0 then | ||
| raise EJclWaitableTimerError.CreateRes(@RsSynchOpenWaitableTimer); | ||
| end; | ||
|
|
@@ -1048,7 +1052,7 @@ constructor TJclSemaphore.Open(Access: Cardinal; Inheritable: Boolean; | |
| begin | ||
| FName := Name; | ||
| FExisted := True; | ||
| FHandle := {$IFDEF HAS_UNITSCOPE}Winapi.{$ENDIF}Windows.OpenSemaphore(Access, Inheritable, PChar(Name)); | ||
| FHandle := {$IFDEF HAS_UNITSCOPE}Winapi.{$ENDIF}Windows.OpenSemaphore(Access, BOOL(Inheritable), PChar(Name)); | ||
| if FHandle = 0 then | ||
| raise EJclSemaphoreError.CreateRes(@RsSynchOpenSemaphore); | ||
| end; | ||
|
|
@@ -1075,7 +1079,7 @@ constructor TJclMutex.Create(SecAttr: PSecurityAttributes; InitialOwner: Boolean | |
| begin | ||
| inherited Create; | ||
| FName := Name; | ||
| FHandle := JclWin32.CreateMutex(SecAttr, InitialOwner, PChar(Name)); | ||
| FHandle := {$IFDEF HAS_UNITSCOPE}Winapi.{$ENDIF}Windows.CreateMutex(SecAttr, BOOL(InitialOwner), PChar(Name)); | ||
| if FHandle = 0 then | ||
| raise EJclMutexError.CreateRes(@RsSynchCreateMutex); | ||
| FExisted := GetLastError = ERROR_ALREADY_EXISTS; | ||
|
|
@@ -1086,7 +1090,7 @@ constructor TJclMutex.Open(Access: Cardinal; Inheritable: Boolean; const Name: s | |
| inherited Create; | ||
| FName := Name; | ||
| FExisted := True; | ||
| FHandle := {$IFDEF HAS_UNITSCOPE}Winapi.{$ENDIF}Windows.OpenMutex(Access, Inheritable, PChar(Name)); | ||
| FHandle := {$IFDEF HAS_UNITSCOPE}Winapi.{$ENDIF}Windows.OpenMutex(Access, BOOL(Inheritable), PChar(Name)); | ||
| if FHandle = 0 then | ||
| raise EJclMutexError.CreateRes(@RsSynchOpenMutex); | ||
| end; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,8 +123,16 @@ constructor TJvForm.Create(AOwner: TComponent); | |
| finally | ||
| Exclude(FFormState, fsCreating); | ||
| end; | ||
| // Keyman local patch: Delphi 11/12 compat (vendored JVCL). The | ||
| // OldCreateOrder property was removed in Delphi 11; the modern semantics | ||
| // are equivalent to OldCreateOrder=True, so always call DoCreate on | ||
| // VER350+. On JVCL refresh from upstream: re-apply if not yet upstreamed. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems wrong according to the documentation for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the docs link — I hadn't checked Athens's own documentation, just found somewhere that mentioned OldCreateOrder was removed and applied a defensive patch. Given the JclSynch outcome, this one falls in the same bucket. Reverted in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Second vindication — reapplied in The Athens docs you linked may still list Same pattern as JclSynch above: the smaller projects you tested didn't pull Apologies again for the churn — trying to be defensive on both patches based on your feedback and it turned out both were needed for the fuller project set.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. |
||
| {$IF Defined(VER350) or Defined(VER360)} | ||
| DoCreate; | ||
| {$ELSE} | ||
| if OldCreateOrder then | ||
| DoCreate; | ||
| {$IFEND} | ||
| end; | ||
| finally | ||
| GlobalNameSpace.EndWrite; | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.