FPC RTL (AnsiString etc)
Posted: Tue Sep 23, 2014 3:32 pm
Hi,
After quite a long time without any work on my OS I decided to find my way back.
I'm using Free Pascal for my kernel code and I'd like to use Ansi- and/or WideStrings.
Those types are Pointer types and the compiler needs to know how to allocate memory and how to do reference counting.
If you use an AnsiString variable in your code the compiler hints some "compilerproc"s which have to be implemented before AnsiStrings will work.
I declared those compilerprocs in system.pas which compiles but it doesn't work at runtime because those procedures are empty for now. In order to allocate any memory for those strings I'd need access to my unit which handles memory allocation.
But it seems like I can't add any unit to my uses in system.pas.
If I write it in the uses of the interface section of system.pas I get this:
Or is there any source where I can read about implementing the fpc rtl?
After quite a long time without any work on my OS I decided to find my way back.
I'm using Free Pascal for my kernel code and I'd like to use Ansi- and/or WideStrings.
Those types are Pointer types and the compiler needs to know how to allocate memory and how to do reference counting.
If you use an AnsiString variable in your code the compiler hints some "compilerproc"s which have to be implemented before AnsiStrings will work.
I declared those compilerprocs in system.pas which compiles but it doesn't work at runtime because those procedures are empty for now. In order to allocate any memory for those strings I'd need access to my unit which handles memory allocation.
But it seems like I can't add any unit to my uses in system.pas.
If I write it in the uses of the interface section of system.pas I get this:
Code: Select all
unit system;
interface
uses
memory;
If i add my memory unit to implementation uses I get this:Fatal: Syntax error, "IMPLEMENTATION" expected but "USES" found
Code: Select all
implementation
uses
memory in '..\kernel\memory.pas'; // I have to specify the path because else the compiler doesn't find the unit at all.
Does anybody know how to do this?Fatal: Internal error 200602044
Or is there any source where I can read about implementing the fpc rtl?