Difference between revisions of "Specifics"

From Freepascal Amiga wiki
Jump to navigation Jump to search
(→‎Specialities of AROS Freepascal: Added info on compiler define "AROS")
m (Added link to multiplatform programming)
Line 9: Line 9:
 
|-
 
|-
 
!Definition AROS
 
!Definition AROS
|There are several [//www.freepascal.org/docs-html/prog/progap7.html#x329-344000G compiler defines (table G.4)] available for Freepascal. The AROS version of FPC adds the definition AROS to that list. This enables you to determine if your program is compiled/targeted for AROS or not. You can use {$IFDEF AROS} or {$IFNDEF AROS} to make use of this define. This would also aid in porting platform specific sources and/or writing FreePascal programs that could be compiled using the [//aminet.net/package/dev/lang/fpc110aami old FPC 1.10 compiler for classic amiga's], [//aminet.net/package/dev/lang/fpc-2.0.4.powerpc-mos MorphOS] and/or [//aminet.net/package/dev/lang/fpc-20060820-powerpc-amiga AmigaOS 4].
+
|There are several [//www.freepascal.org/docs-html/prog/progap7.html#x329-344000G compiler defines (table G.4)] available for Freepascal. The AROS version of FPC adds the definition AROS to that list. This enables you to determine if your program is compiled/targeted for AROS or not. You can use {$IFDEF AROS} or {$IFNDEF AROS} to make use of this define. This would also aid in porting platform specific sources and/or writing FreePascal programs that could be compiled using the [//aminet.net/package/dev/lang/fpc110aami old FPC 1.10 compiler for classic amiga's], [//aminet.net/package/dev/lang/fpc-2.0.4.powerpc-mos MorphOS] and/or [//aminet.net/package/dev/lang/fpc-20060820-powerpc-amiga AmigaOS 4]. More on multiplatform programming can be found [//wiki.freepascal.org/Multiplatform_Programming_Guide here].
 
|-
 
|-
 
|
 
|

Revision as of 21:26, 18 September 2013

Specialities of AROS Freepascal

in Relation to other Freepascal implementations.


The compiler:

has additional features:

Definition AROS There are several compiler defines (table G.4) available for Freepascal. The AROS version of FPC adds the definition AROS to that list. This enables you to determine if your program is compiled/targeted for AROS or not. You can use {$IFDEF AROS} or {$IFNDEF AROS} to make use of this define. This would also aid in porting platform specific sources and/or writing FreePascal programs that could be compiled using the old FPC 1.10 compiler for classic amiga's, MorphOS and/or AmigaOS 4. More on multiplatform programming can be found here.


System unit:

has some additional functions and variables:

Be warned if you change any of the variables then your program will crash and most likely your computer as well.

Debug(Msg: string); DebugLn(Msg: string); Write a message to debug out put of AROS, in hosted mode you can find this output in the shell you started AROS from. if you want to read the messages in AROS (or you have a native installation) you can use Sashimi to catch the output. DebugLn() adds a return after the message, Debug() does not.
function GetLibAdress(Base: Pointer; Offset: LongInt): Pointer; Function to calculate the function pointer from the library base and the offset. Needed to call AROS library functions. For an example see Call Library
AOS_WbMsg: Pointer; Real Type is PWBStartup (from "Workbench" unit) can be used to determine if the program was started from WB (if this pointer is Nil then it was started from CLI)
AOS_ExecBase: Pointer; Real type is: PExecBase (from "Exec" Unit) can be used to call all exec.library calls, or to inspect system basic features
AOS_DOSBase: Pointer; Real type is: PDOSBase (from "AmigaDos" Unit) can be used to call all dos.library calls
AOS_UtilityBase: Pointer; Real type is: PUtilityBase (from "Utility" Unit) can be used to call all utility.library calls
AOS_heapPool: Pointer; Its a Pool Header created with (CreatePool from exec), all memory allocations are created in this pool, could be used to AllocPooled memory as well (even AllocMem, New and so on do it automatically)