Pure FB Runtime Library (in progress)
-
- Site Admin
- Posts: 6323
- Joined: Jul 05, 2005 17:32
- Location: Manchester, Lancs
Re: Pure FB Runtime Library (in progress)
Yeah, 'for(;;)' is a common idiom for an "endless" loop. Presumably the loop body has a 'break' statement somewhere.
Re: Pure FB Runtime Library (in progress)
Correct. I was pretty sure that I could just replace it, but wanted to ask someone a bit more knowledgeable.counting_pine wrote:... Presumably the loop body has a 'break' statement somewhere.
Re: Pure FB Runtime Library (in progress)
signals.c requires a c header called signal.h I am not sure if that can be converted directly or if there should be a different code to replace that.
Any one have some insight on this one?
Also: crt/getopt.bi does not seem to exist in our crt headers, but it is called in crt/win32/unistd.bi. The linux and DOS versions of that file have a whole lot more content in them. Is this a problem with the unistd.bi file for win32 or with the getopt.bi file not existing?
Any one have some insight on this one?
Also: crt/getopt.bi does not seem to exist in our crt headers, but it is called in crt/win32/unistd.bi. The linux and DOS versions of that file have a whole lot more content in them. Is this a problem with the unistd.bi file for win32 or with the getopt.bi file not existing?
Re: Pure FB Runtime Library (in progress)
Also, as a sanity check:
in c is equivilant to
in FB right?
Code: Select all
*--dst
Code: Select all
dst[-1]
Re: Pure FB Runtime Library (in progress)
It also decrements dst.Imortis wrote:Also, as a sanity check:in c is equivilant toCode: Select all
*--dst
in FB right?Code: Select all
dst[-1]
Re: Pure FB Runtime Library (in progress)
dst is a ptr. Is it decrementing the pointer or the value? I thought it was the ptr.
Re: Pure FB Runtime Library (in progress)
The pointer ist decremented first, then the (decremented) pointer is dereferenced.Imortis wrote:dst is a ptr. Is it decrementing the pointer or the value? I thought it was the ptr.
dst[-1] does not update the pointer.
Re: Pure FB Runtime Library (in progress)
Ah! So it would be better to replace it with this:
Code: Select all
dst -= 1
*dst = blah blah blah
Re: Pure FB Runtime Library (in progress)
Yes.Imortis wrote:Ah! So it would be better to replace it with this:Code: Select all
dst -= 1 *dst = blah blah blah
btw there are nice webservices to test all kinds of code, even including C/C++ or FreeBasic. For the discussed code e.g. try this: https://repl.it/repls/WorriedFrenchAurochs
Re: Pure FB Runtime Library (in progress)
I did not know this was a thing. Thanks for the link it will be helpful, indeed.St_W wrote:https://repl.it/repls/WorriedFrenchAurochs
Re: Pure FB Runtime Library (in progress)
I just hit a pretty big milestone:
Every non-OS specific file had been converted! I also got to work on the Darwin files but his a bit of a snag. They include a header for Mach-O stuff, which is mac only. It looks like they only use one function, but I am unsure how much of the headers are required to make that one function work. If anyone wants to take a look, please do.
https://github.com/ImortisInglorian/fbr ... ter/darwin
In the mean time I am going to tackle the other OS-specific files. DOS is up next.
Every non-OS specific file had been converted! I also got to work on the Darwin files but his a bit of a snag. They include a header for Mach-O stuff, which is mac only. It looks like they only use one function, but I am unsure how much of the headers are required to make that one function work. If anyone wants to take a look, please do.
https://github.com/ImortisInglorian/fbr ... ter/darwin
In the mean time I am going to tackle the other OS-specific files. DOS is up next.
-
- Posts: 1002
- Joined: Jul 14, 2005 23:41
Re: Pure FB Runtime Library (in progress)
Great work Imortis, you can be sure that the whole community is rooting for you and great success for this project. It will help move FB forward immensely. Awesome!
Re: Pure FB Runtime Library (in progress)
So, there is a file called cpudetect.s It is assembly passed to GCC. Could this be passed directly to GAS or even converted into a bas file using asm...end asm blocks? I tried to find info about what syntax the .s files use, but I could not find anything concrete from a quick google search.
Re: Pure FB Runtime Library (in progress)
Afaik gcc only processes .S files with a preprocessor so that they become .s files. So if it has #ifdefs, it might need preprocessing
Re: Pure FB Runtime Library (in progress)
Just create a BAS file with inline assembly, if needed. As long as the function signature and calling convention matches everything should be fine.Imortis wrote:So, there is a file called cpudetect.s It is assembly passed to GCC. Could this be passed directly to GAS or even converted into a bas file using asm...end asm blocks? I tried to find info about what syntax the .s files use, but I could not find anything concrete from a quick google search.