Search found 2813 matches

by dkl
Dec 09, 2017 22:08
Forum: Projects
Topic: compile-time bindgen for FB
Replies: 10
Views: 340

Re: compile-time bindgen for FB

Well, I've been experimenting with libclang in fbfrog (after finding a bug in fbfrog's custom CPP), and making it single-target only. It's close to a full rewrite: By using libclang, most of the existing C parsing code becomes obsolete and must be replaced with a libclang AST parser. And being singl...
by dkl
Dec 07, 2017 10:03
Forum: Projects
Topic: compile-time bindgen for FB
Replies: 10
Views: 340

compile-time bindgen for FB

Hi, FB bindings for C/C++ are a recurring issue, something I've been personally interested in, and spent a lot of time on. But no matter how good the .bi files are, they're always outdated... How about making a binding generator for FB that runs during .bas file compilation, like #include_c "fo...
by dkl
Nov 29, 2017 18:49
Forum: Projects
Topic: fbfrog header translator
Replies: 34
Views: 4867

Re: fbfrog header translator

Yea, fbfrog tries to parse all #includes, but currently it also ignores the ones that can't be found. It's somewhat useful for making .bi files for .h files that would normally use system headers, but without having the system headers. So fbfrog also resolves #ifdefs and macros, but the result can b...
by dkl
Nov 28, 2017 17:01
Forum: Projects
Topic: fbfrog header translator
Replies: 34
Views: 4867

Re: fbfrog header translator

I saved your source as nn.h and ran fbfrog like this: $ fbfrog nn.h -emit '*/nn.h' nn.bi [ 1/23] linux-x86 [ 2/23] linux-x86_64 [ 3/23] linux-arm [ 4/23] linux-aarch64 [ 5/23] freebsd-x86 [ 6/23] freebsd-x86_64 [ 7/23] freebsd-arm [ 8/23] freebsd-aarch64 [ 9/23] openbsd-x86 [10/23] openbsd-x86_64 [1...
by dkl
Nov 28, 2017 8:11
Forum: Projects
Topic: fbfrog header translator
Replies: 34
Views: 4867

Re: fbfrog header translator

It could be a problem with the -emit options, maybe it will work if you add a * wildcard:

Code: Select all

-emit 'nn.h' ./target/nn.bi
-emit '*/nn.h' ./target/nn.bi


Also it can help to try without any -emit.
by dkl
Nov 15, 2017 19:42
Forum: Windows
Topic: Cannot compile fbfrog
Replies: 3
Views: 166

Re: Cannot compile fbfrog

fbfrog consists of multiple .bas files (the whole src/ folder), so fbfrog.bas alone is not enough. For current master, there is a makefile, or you can also do:
fbc src/*.bas -m fbfrog
by dkl
Nov 13, 2017 18:24
Forum: Linux
Topic: How to resolve these 'TODO' GTK bindings
Replies: 10
Views: 229

Re: How to resolve these 'TODO' GTK bindings

It looks like they are internal macros that aren't needed in the FB binding, so they can probably be dropped/ignored. For fbfrog: -removedefine GTK_SOURCE_DEPRECATED_*

Producing #ifs with fbfrog is possible but difficult, see also the example for freeglut's FREEGLUT_STATIC or the readme.
by dkl
Nov 12, 2017 21:38
Forum: Linux
Topic: How to resolve these 'TODO' GTK bindings
Replies: 10
Views: 229

Re: How to resolve these 'TODO' GTK bindings

Normally G_GNUC_CONST should be #defined somewhere (looks like it's from glib headers), but fbfrog didn't see it. If you provide the glib headers too, then it should be solved out automatically. For example: fbfrog \ -incdir gtk+-x.xx.x \ -incdir glib-x.xx.x \ -incdir glib-x.xx.x/glib \ -incdir glib...
by dkl
Nov 10, 2017 16:50
Forum: Documentation
Topic: -pp compiler option
Replies: 36
Views: 731

Re: -pp compiler option

It's probably easiest to put small examples (.bas files, fbc invocation, resulting output). That should set the proper expectations, shouldn't it?
by dkl
Nov 08, 2017 19:59
Forum: Community Discussion
Topic: NOT operator like AndAlso/OrElse?
Replies: 3
Views: 186

Re: NOT operator like AndAlso/OrElse?

You could say that "= 0" or "= false" is that operator. That's what I ended up doing anyways.
by dkl
Nov 02, 2017 6:17
Forum: General
Topic: [solved]I found a new reserved keyword :-)
Replies: 7
Views: 186

Re: I found a new reserved keyword :-)

That feels familiar...

Code: Select all

foobar: print "foobar" : sleep 1000, 1
goto foobar
by dkl
Nov 01, 2017 18:00
Forum: Libraries
Topic: Windows header translation issue for Array values
Replies: 4
Views: 182

Re: Windows header translation issue for Array values

The problem should be solved for SECURITY_NT_AUTHORITY and some others in Git, see commit winapi: Fix winnt.h SECURITY_*_AUTHORITY initializers . That's one of the issues I couldn't figure out when working on fbfrog. The problem is that a C initializer like {1, 2} works with struct or array, but in ...
by dkl
Oct 31, 2017 17:43
Forum: Beginners
Topic: Allocate memory
Replies: 7
Views: 342

Re: Allocate memory

Hi, pointers don't know the buffer size, so it's common practice to save the size in a variable next to the pointer and keep/pass them together. In other words, the program has to track the buffer size manually. It can be done by keeping a size variable/parameter next to the pointer, which can even ...
by dkl
Oct 31, 2017 14:51
Forum: General
Topic: Compatibility with older FB versions?
Replies: 1
Views: 94

Re: Compatibility with older FB versions?

The language has been mostly backwards compatible since at least the 0.20 release, but there have always been some changes... mainly due to improvements and bug fixes in the compiler that result in behaviour changes in some cases. Some of the newly added features (e.g. new keywords) can also cause o...
by dkl
Oct 31, 2017 14:40
Forum: General
Topic: MessageBoxW and cyrillic captions
Replies: 2
Views: 144

Re: MessageBoxW and cyrillic captions

For putting Unicode into a string literal, the .bas file must have a BOM, causing string literals to be treated as WString. The rest depends on Windows (the GUI font must support rendering the glyphs). Without BOM, fbc makes it a ZString and just puts the raw bytes into it, which depends on the text...

Go to advanced search