Sign in Join
Wiki copytemporary

User Changes 2.4.4: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## About this page
22
33Below you can find a list of intentional changes since the [[User Changes 2.4.2|previous release]] that can change the behaviour of previously working code, along with why these changes were performed and how you can adapt your code if you are affected by them.
44
55### Unit changes
66
77#### OpenSSL
88
99- **Old behaviour**: The *openssl* unit contained an *EVP_PKEY* type.
1010- **New behaviour**: The *EVP_PKEY* type has been renamed into *PEVP_PKEY*.
1111- **Reason**: Consistency with other similar types and with the original C declaration.
1212- **Remedy**: Make the same typename change in your source code.
1313
1414#### Graph unit aspect ratio changes in Arc and PieSlice
1515
1616- **Old behaviour**: Graph unit procedures Arc and PieSlice always assumed a 1:1 aspect ratio, regardless of current mode's aspect ratio.
1717- **New behaviour**: Arc and PieSlice now respect the current aspect ratio.
1818- **Reason**: Borland Pascal compatibility; better (i.e. more 'circular') looks of arcs and pie slices in modes with weird aspect ratios like 640x200; consistency with the Circle procedure, which already respects the current aspect ratio.
1919- **Remedy**: This change is only likely to affect you, if you use a graphical mode with an aspect ratio, different than 1:1. Note that VGA 640x480 and higher modes usually always have a 1:1 aspect ratio. 320x200, 640x200, 640x350 and 640x400, however, do not. If you use one of these modes and, for some reason, don't want aspect ratio compensation in Arc and PieSlice, either call:
2020
21-`SetAspectRatio(10000, 10000)`
21+```text
22+SetAspectRatio(10000, 10000)
23+```
2224
2325immediately after InitGraph (this will also change the behaviour of Circle) or replace:
2426
25-`Arc(X, Y, StAngle, EndAngle, Radius) with Ellipse(X, Y, StAngle, EndAngle, Radius, Radius)`
27+```text
28+Arc(X, Y, StAngle, EndAngle, Radius) with Ellipse(X, Y, StAngle, EndAngle, Radius, Radius)
29+```
2630
2731and
2832
29-`PieSlice(X, Y, StAngle, EndAngle, Radius) with Sector(X, Y, StAngle, EndAngle, Radius, Radius)`
33+```text
34+PieSlice(X, Y, StAngle, EndAngle, Radius) with Sector(X, Y, StAngle, EndAngle, Radius, Radius)
35+```
3036
3137#### Graph unit aspect ratio changes in GraphDefaults
3238
3339- **Old behaviour**: The GraphDefaults procedure used to reset the current aspect ratio to 1:1, regardless of the current mode's default aspect ratio.
3440- **New behaviour**: GraphDefaults no longer changes the current aspect ratio.
3541- **Reason**: Borland Pascal compatibility; bug fix for applications that call GraphDefaults in modes with an aspect ratio different than 1:1 and still want to use aspect ratio compensation, since the old behaviour effectively disabled any aspect ratio compensation.
3642- **Remedy**: If you want to reset the current aspect ratio to 1:1, just call:
3743
38-`SetAspectRatio(10000, 10000)`
44+```text
45+SetAspectRatio(10000, 10000)
46+```
3947
4048#### TThread.Suspend and TThread.Resume have been deprecated
4149
4250- **Old behaviour**: *TThread.Suspend* suspended the thread if the platform supported it, while *TThread.Resume* would resume an explicitly suspended thread, or a thread created as "suspended".
4351- **New behaviour**: Suspending running threads has been deprecated. Creating threads suspended is still supported, and a new *TThread.Start* method has been added to tell such threads that they can start running.
4452- **Reason**: Embarcadero Delphi (D2010+) compatibility, and the fact that arbitrarily suspending running threads is unsupported on most platforms because of inherent deadlock problems. Related concerns presumably played part in Embarcadero's decision. Such functionality was also removed from Java for [similar reasons](http://download.oracle.com/javase/1.4.2/docs/guide/misc/threadPrimitiveDeprecation.html).
4553- **Remedy**: For threads created as *suspended*, replace *resume* with *start*. For suspending running threads: rewrite so this functionality is no longer needed. Note that there are no short term plans to remove *resume* to start suspended threads. If you want to share code with old Delphi versions, using *resume* will remain working for starting threads that were created as *suspended* for several FPC releases to come. Just ignore the warning.
4654
4755#### Default TFPPixelCanvas brush style
4856
4957- **Old behaviour**: A brush in *TFPPixelCanvas* would start with the style *bsClear*
5058- **New behaviour**: Now it starts with the style *bsSolid*
5159- **Reason**: Starting with *bsSolid* is more intuitive and is also the state in which LCL brushes start.
5260- **Remedy**: Initialize the brush to *bsClear* after creating your *TFPPixelCanvas* if your code depended on it starting in this state.
5361
5462#### Glut.FreeGlut function renamed to UnloadGlut
5563
5664- **Old behaviour**: Glut unit contained a function called FreeGlut.
5765- **New behaviour**: This function is now renamed to UnloadGlut.
5866- **Reason**: We now include a FreeGlut unit, exposing <http://freeglut.sourceforge.net/> -specific functionality. Function name "FreeGlut" inside Glut unit would cause name clashes and confusion (as it's not related to freeglut library).
5967- **Remedy**: Make the same rename in your source code.
6068
6169#### xmlxsd unit split into xmlxsd and xmlxsdparser
6270
6371- **Old behaviour**: xmlxsd contained functions for parsing xml xsd types and helper functions for libxml2.
6472- **New behaviour**: xmlxsd contains only the helper functions for libxml2, all the parser functions are moved to the xmlxsdparser unit.
6573- **Reason**: xmlxsd allways required the external library libxml2. But if somebody was using just the xsd type parser code, he had to include the libxml2 library also. Now all the xsd type parser functions are in xmlxsdparser. This new unit is not depandant of the external libxml2 library.
6674- **Remedy**: If you are interested in the full libxml2 and xsd functionality, simply add xmlxsdparser to the uses list (besides xmlxsd). If you are interested only in the xsd type parser code, remove xmlxsd (and maybe libxml2) unit and use only xmlxsdparser.
6775
6876## Previous release notes
6977
7078---
7179*From the Free Pascal wiki, page "User Changes 2.4.4", as it stood on 2015-05-09 after a change by Socke, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
7280Category: FPC User Changes by release
7381Category: Release Notes

Back to history