Search found 298 matches

by TeeEmCee
May 04, 2020 15:39
Forum: Community Discussion
Topic: fbfrog is unmaintained, so what is the current supported tool to translate C header?
Replies: 8
Views: 520

Re: fbfrog is unmaintained, so what is the current supported tool to translate C header?

Failed in cases that it didn't need to? (E.g. IIRC it ignores some common GCC function attributes but not all that are safe to ignore)
by TeeEmCee
May 04, 2020 15:33
Forum: Community Discussion
Topic: FreeBASIC and C++ interop current status?
Replies: 15
Views: 928

Re: FreeBASIC and C++ interop current status?

Right. I jumped to the conclusion that total interoperability with a subset of C++ was the goal. But there are other reasons for doing name mangling in the same way, such as: it's sane to follow standards, be able to use the standard "c++filt" name demangling tool, or just being able to ca...
by TeeEmCee
May 04, 2020 15:08
Forum: Beginners
Topic: Could I use fbc -gen gcc with clang as the compiler?
Replies: 21
Views: 917

Re: Could I use fbc -gen gcc with clang as the compiler?

in 32-bit I had to pass -asm att to fbc otherwise clang would spit-out many errors related to fpu operand size not being specified. I'm confused... did you pass -r to fbc? If so, it should produce a .c file only, and "-asm att" would be ignored. Must try MacOS and Android. I haven't tried...
by TeeEmCee
May 04, 2020 14:43
Forum: Community Discussion
Topic: anyone still in contact with cha0s?
Replies: 2
Views: 256

Re: anyone still in contact with cha0s?

cha0s is in the FreeBASIC Discord server right now, last spoke yesterday.
by TeeEmCee
May 04, 2020 12:18
Forum: Beginners
Topic: Could I use fbc -gen gcc with clang as the compiler?
Replies: 21
Views: 917

Re: Could I use fbc -gen gcc with clang as the compiler?

Sorry for the confusion, I meant Iedited my post to use the simpler method (which is to use fbc to link instead of clang).
by TeeEmCee
May 04, 2020 11:55
Forum: Community Discussion
Topic: fbfrog is unmaintained, so what is the current supported tool to translate C header?
Replies: 8
Views: 520

Re: fbfrog is unmaintained, so what is the current supported tool to translate C header?

fbfrog is an amazing tool. Who cares if it's unmaintained if it's already close to perfect? C evolves very slowly, so fbfrog doesn't need to change any faster.

I do release fbfrog has a todo list, no piece of software is complete.
by TeeEmCee
May 04, 2020 10:47
Forum: Beginners
Topic: Could I use fbc -gen gcc with clang as the compiler?
Replies: 21
Views: 917

Re: Could I use fbc -gen gcc with clang as the compiler?

fbc doesn't support clang out of the box when using -gen gcc yet, but I think it's not a lot of work to make this work. You can however manually compile the C produced from fbc using clang. Not long ago I also tried to get -gen gcc working using Visual C++ instead of GCC. That's far more work. (gcc ...
by TeeEmCee
May 04, 2020 2:15
Forum: Community Discussion
Topic: FreeBASIC and C++ interop current status?
Replies: 15
Views: 928

Re: FreeBASIC and C++ interop current status?

It all looks a bit quaint because the decorated names are used. I thought that fbc decorates method names and overloaded functions in the same way as gcc? But IIRC there are some edge cases involving certain types of constructor where it isn't compatible yet. And I don't know how good the ABI compa...
by TeeEmCee
May 04, 2020 2:02
Forum: Community Discussion
Topic: GCC compiler question
Replies: 10
Views: 524

Re: GCC compiler question

I would suggest not combining the FB and GCC/msys directory trees, so you can more cleanly upgrade. On Windows I have msys/mingw and multiple FB versions all in separate directories, and switch between them by changing my PATH. You just need to install a copy of FB that's built either for mingw or m...
by TeeEmCee
May 04, 2020 1:54
Forum: Linux
Topic: Multi-call binary in FreeBasic
Replies: 3
Views: 432

Re: Multi-call binary in FreeBasic

COMMAND(0) doesn't read from /proc/self/cmdline, it returns the argv[0] passed to main(). I have no idea whether that differs from /proc/self/cmdline, but it is possible to get different opinions of what the name of a program is (e.g. ps has "comm" vs "args" format keywords) But ...
by TeeEmCee
May 04, 2020 1:40
Forum: General
Topic: How to translate C headers contain gcc __attribute__?
Replies: 45
Views: 1568

Re: How to translate C headers contain gcc __attribute__?

You should just remove the #include for sys/queue.h from the Kore headers unless it's actually needed in the header itself. I doubt anyway would want to use those list macros in FB, they should use some native FB list/queue library instead. I don't think they should be part of FB's crt include files...
by TeeEmCee
May 01, 2020 8:13
Forum: General
Topic: How to translate C headers contain gcc __attribute__?
Replies: 45
Views: 1568

Re: How to translate C headers contain gcc __attribute__?

You could translate json_object_foreach to: #macro json_object_foreach(object, key, value) key = json_object_iter_key(json_object_iter(object)) while key value = json_object_iter_value(json_object_key_to_iter(key)) if value = 0 then exit while #endmacro #macro end_json_object_foreach(object, key, va...
by TeeEmCee
Apr 30, 2020 15:45
Forum: General
Topic: How to translate C headers contain gcc __attribute__?
Replies: 45
Views: 1568

Re: How to translate C headers contain gcc __attribute__?

Actually, FB does kind of support inlining functions. Define a function as PRIVATE. This gets translated to "static" in the emitted C when using -gen gcc. This encourages GCC to inline the function. Marking a function as "inline" in C only hints to the compiler to inline, anyway ...
by TeeEmCee
Apr 30, 2020 14:51
Forum: Linux
Topic: Trying to port existing Freebasic from Windows to Android
Replies: 3
Views: 405

Re: Trying to port existing Freebasic from Windows to Android

Eventually fbgfx should get ported to Android too, so that graphical apps are possible directly without needing to rewrite your code to SDL/etc. There's an experimental (unofficial and unfinished) SDL2 backend for fbgfx which could be the most promising avenue for porting fbgfx-based programs to And...
by TeeEmCee
Apr 18, 2020 13:40
Forum: Community Discussion
Topic: What do you use FreeBASIC for?
Replies: 91
Views: 4448

Re: What do you use FreeBASIC for?

Commercial FB projects are particularly interesting (I'd like to hear more), but you can also ask what are the largest FB programs? Well, I'm sadly ignorant, so I went looking for some. I'm going to count lines of FB code (including header files but excluding bindings and thirdparty libraries) becau...

Go to advanced search