Search found 262 matches

by TeeEmCee
Dec 15, 2017 1:27
Forum: Projects
Topic: compile-time bindgen for FB
Replies: 18
Views: 2914

Re: compile-time bindgen for FB

I like counting_pine's suggestion. I was about to suggest something similar. It seems simpler to distribute .bi files with FB which #include_c the original header and then add whatever couldn't be translated to FB, than to have to deal with a DSL for specifying the "hints". fbfrog works be...
by TeeEmCee
Dec 13, 2017 3:28
Forum: Projects
Topic: UTF-8 Variable Length String Library
Replies: 35
Views: 3258

Re: UTF-8 Variable Length String Library

Awesome; I'll just use these rather than continue my own project. However having support built into FB would still be a huge improvement, for type checking. Why did you make this a single .bi file rather than a .bas and .bi pair? Anyone who wants to use it will have to manually split it into two fil...
by TeeEmCee
Dec 07, 2017 9:54
Forum: Projects
Topic: Pure FB Runtime Library (in progress)
Replies: 210
Views: 18650

Re: Pure FB Runtime Library (in progress)

Why not just call atexit? Your library still depends on the C runtime library. New question: win32/sys_portio.c has these lines in it: __asm__ volatile ("inb %1, %0" : "=a" (value) : "d" (port)); __asm__ volatile ("outb %0, %1" : : "a" (value), "...
by TeeEmCee
Dec 07, 2017 8:49
Forum: Community Discussion
Topic: The RETURN of GOSUB
Replies: 34
Views: 8764

Re: The RETURN of GOSUB

Trivia: as you can see in the thread fxm linked to from 2006, I created my own reimplementation of GOSUB/RETURN (called GOSUB/RETRACE) using either asm or setjmp/longjmp, which could be used in -lang fb. However it didn't support -gen gcc. We finally got rid of it and the last of the GOSUBs in the O...
by TeeEmCee
Dec 07, 2017 6:56
Forum: Projects
Topic: UTF-8 Variable Length String Library
Replies: 35
Views: 3258

Re: UTF-8 Variable Length String Library

Cool! I also used "type ustring as string" to denote a string containing UTF8 characters. I haven't gotten around to writing replacements for all the builtin string functions/statements yet, though. I think UTF8 strings really should be added to FB as a native data type, with ustring overl...
by TeeEmCee
Oct 29, 2017 14:02
Forum: Linux
Topic: OpenBSD porting work
Replies: 4
Views: 651

Re: OpenBSD porting work

Yes, as an example, many of the existing include files distributed with FB were generated with SWIG. dkl has been replacing them with new headers generated with fbfrog, which has resulted in some breaking changes, but the results do seem better. The crt/system headers are still SWIG+hand written. Th...
by TeeEmCee
Oct 28, 2017 14:05
Forum: Linux
Topic: OpenBSD porting work
Replies: 4
Views: 651

Re: OpenBSD porting work

Thanks for that link. dkl's fbfrog does automatic 'parameterisation': it combines multiple versions of include files from different OSes into one, spliced with ifdef's. I think it can merge multiple FB headers in a separate step after they've been translated individually, but I'm not sure. If so, th...
by TeeEmCee
Oct 28, 2017 12:21
Forum: Community Discussion
Topic: FreeBASIC OpenBSD package
Replies: 15
Views: 1582

Re: FreeBASIC OpenBSD package

Does FB 1.05 work on FreeBSD if you manually force -asm att, like for OpenBSD? I would guess yes, but didn't try it. Maybe that there are almost no users (are there any aside from me?) for that reason and that there are no official releases and it's not listed as supported. I had a quick look at the...
by TeeEmCee
Oct 27, 2017 15:17
Forum: Community Discussion
Topic: FreeBASIC OpenBSD package
Replies: 15
Views: 1582

Re: FreeBASIC OpenBSD package

OK, I created a new thread for discussing the porting details. Better to discuss in the open rather than email, as there are other people working on related FB ports like Mac and FreeBSD, aside from you and I. FB does intend to officially support OpenBSD. The fact that OpenBSD and other OSes aren't ...
by TeeEmCee
Oct 27, 2017 15:16
Forum: Linux
Topic: OpenBSD porting work
Replies: 4
Views: 651

OpenBSD porting work

This thread is split off of FreeBASIC OpenBSD package to discuss work to properly support OpenBSD. I downloaded an OpenBSD install disc but don't have time to install and play around for a few days. On OpenBSD, this compiler happens to be named egcc, as to not conflict with some architectures that h...
by TeeEmCee
Oct 25, 2017 10:22
Forum: Community Discussion
Topic: FreeBASIC OpenBSD package
Replies: 15
Views: 1582

Re: FreeBASIC OpenBSD package

Thank you! I was just looking into creating a FreeBSD portfile yesterday, and will base it off of yours. # All they seem to support. ONLY_FOR_ARCHS = amd64 i386 arm and aarch64 targets are supported. I'm not really clear how different ARM CPUs and ABIs are handled (fbc only understands the names arm...
by TeeEmCee
Oct 16, 2017 22:41
Forum: Projects
Topic: Pure FB Runtime Library (in progress)
Replies: 210
Views: 18650

Re: Pure FB Runtime Library (in progress)

Those functions are in crt/io.bi rather than direct.h FPC has a strong module system, and regardless of backend (can be JVM, can link to objective C etc) or object format, there is always a precompiled header per module with such info (.ppu), and all modules must be compiled (and their info loaded) ...
by TeeEmCee
Oct 16, 2017 14:35
Forum: Projects
Topic: Pure FB Runtime Library (in progress)
Replies: 210
Views: 18650

Re: Pure FB Runtime Library (in progress)

But that requires actually having a list of module initialisers. The gas backend could do that by embedding metadata in object files which is then read at the linking stage. But to do that in the gcc backend without inspecting the object files (eg for constructor functions which are recognisable by ...
by TeeEmCee
Oct 15, 2017 22:10
Forum: Projects
Topic: Pure FB Runtime Library (in progress)
Replies: 210
Views: 18650

Re: Pure FB Runtime Library (in progress)

FBRT0.bas: to write this as pure FB, then would have to add an __attribute__() type feature in to FB. ... But even with C this is non-standard and not completely portable as DJ handles global ctors/dtors in DOS differently than on win/*nix. Quite possible that unknown future targets will be differe...
by TeeEmCee
Oct 15, 2017 11:58
Forum: Projects
Topic: Pure FB Runtime Library (in progress)
Replies: 210
Views: 18650

Re: Pure FB Runtime Library (in progress)

What, really? I've never heard of delegating something like that to the kernel on Unix, though I would expect memcpy on Windows to just call the equivalent routine in user32.dll (which is still user-mode, not part of the kernel). It seems crazy to do a syscall for an optimised memcpy, since that add...

Go to advanced search