Search found 2841 matches

by dkl
Sep 01, 2017 16:42
Forum: Libraries
Topic: undefined reference to `LoadIconMetric'
Replies: 16
Views: 2072

Re: undefined reference to `LoadIconMetric'

Hi, Thanks for taking a look at these problems. That's exactly the kind of technical problems you have to deal with in FB for Windows. I'd like to mention that the current winapi headers were mostly auto-translated with fbfrog, which is why the UNICODE/_WIN32_WINNT #ifs are somewhat ugly. I limited ...
by dkl
Jun 06, 2017 17:40
Forum: Community Discussion
Topic: FreeBASIC in Antergos Linux (and possibly Arch and derivatives)
Replies: 14
Views: 1600

Re: FreeBASIC in Antergos Linux (and possibly Arch and derivatives)

Hm, I don't remember fbc ever linking FB programs against both libncurses and libtinfo at the same time. I think originally fbc only linked FB programs to ncurses, and it could be reverted back to it (partially revert 2a110bee). I don't remember any reason for using libtinfo only, besides trying to ...
by dkl
May 22, 2017 15:54
Forum: Community Discussion
Topic: Currently inactive
Replies: 45
Views: 6866

Currently inactive

Hi everyone, I'd like to let everyone know that I'm no longer actively working on the FreeBASIC Compiler project. Last year was already very slow, this year is the same so far, so to be fair and clear, I thought it's time to admit it. I no longer have the same interest and time for fbc as before. Fo...
by dkl
Apr 24, 2017 17:53
Forum: Community Discussion
Topic: Problem making a Dialog Box
Replies: 22
Views: 1862

Re: Problem making a Dialog Box

Hmm, I looked at the DialogBoxIndirect() documentation and it says that it wants a header ... followed by one or more additional blocks of data. So apparently having just the DLGTEMPLATE is not enough and will lead to a buffer overflow.
by dkl
Apr 16, 2017 23:53
Forum: Projects
Topic: fbfrog header translator
Replies: 52
Views: 8828

Re: fbfrog header translator

It's possible to tell fbfrog to only emit parts of the input (filtered by input file name), or to drop symbol declarations by name pattern. That's how I used it - parse the whole API in one go, then emit the needed parts, check if anything is missing afterwards. For example: freeglut or libcairo A w...
by dkl
Apr 16, 2017 10:10
Forum: Projects
Topic: fbfrog header translator
Replies: 52
Views: 8828

Re: fbfrog header translator

The size_t handling is currently hard-coded , so the only way to disable it would be to remove it from that internal table. It might not be a 100% precise translation, but I assumed that size_t will always be the same as UInteger, so might aswell use that. Indeed, adding support for & => byref i...
by dkl
Apr 07, 2017 18:27
Forum: Community Discussion
Topic: Download Website Security Issue FIXED
Replies: 13
Views: 1544

Re: ATTENTION TO FB DEV - DOWNLOAD WEBSITE SECURITY ISSUE?

Yea, same here. Looks like https://sourceforge.net/projects/fbc/files/ works (instead of the shorthand sf.net).
by dkl
Mar 17, 2017 18:05
Forum: Windows
Topic: CPUDETECT.S, error building rtlib on windows
Replies: 22
Views: 4055

Re: CPUDETECT.S, error building rtlib on windows

Yea, the problem usually is that the uname command from MSYS returns 32bit even if you have a 64bit gcc, so the FB makefile thinks it's building for 32bit, and chooses sources files, pre-#defines and directory layout accordingly, but uses the 64bit gcc when compiling stuff. I think that problem is s...
by dkl
Mar 17, 2017 17:50
Forum: Beginners
Topic: Weird destructor problem
Replies: 10
Views: 866

Re: Weird destructor problem

I think a destroy() or close() method would be best. It should close/destroy the window, and clear the internal data structures (e.g. set handles to NULL, etc.), so it will do nothing if called again. Then the destructor would also call the destroy() method, to automatically destroy the window if it...
by dkl
Feb 28, 2017 17:29
Forum: General
Topic: warning: array subscript is below array bounds
Replies: 2
Views: 595

Re: warning: array subscript is below array bounds

Hmm, it looks like this part of FB's implementation of arrays is undefined behaviour in C (pointer arithmetic outside the array boundaries even though it's never dereferenced). I guess that's why there is a warning (I'm not getting it here by the way, with x86_64-linux-gnu gcc 5.4.0 or x86_64-w64-mi...
by dkl
Feb 21, 2017 18:04
Forum: General
Topic: Linking Problem
Replies: 4
Views: 583

Re: Linking Problem

Try removing the "lib" prefix from the #inclib; it will be added automatically, like the .a file extension.

Code: Select all

#Inclib "FSUIPC_FB"
by dkl
Feb 13, 2017 17:57
Forum: General
Topic: Byval as T, or Byref as Const T, pro and cons?
Replies: 4
Views: 631

Re: Byval as T, or Byref as Const T, pro and cons?

Byval (passing by copy) is good for small objects (4 or 8 bytes, a bit more will still be ok) that are easy to copy, like Integers. Passing Byval avoids the overhead of the pointer used by Byref. Byref is better for passing huge objects like strings or big UDTs that shouldn't be copied. Even though ...
by dkl
Feb 12, 2017 19:57
Forum: General
Topic: fbc complaining about unique names in udt...
Replies: 2
Views: 361

Re: fbc complaining about unique names in udt...

Looks like there's a compiler bug with #includes inside Type blocks. It's not working properly, and probably shouldn't be allowed at all anyways. Imagine if it really worked and expanded the #included files in that place: All the function declarations would end up declaring methods in that Type bloc...
by dkl
Feb 10, 2017 23:02
Forum: General
Topic: problem const address from string literal !
Replies: 1
Views: 299

Re: problem const address from string literal !

When declaring a constant (with Const at the beginning) it must be a compile-time constant. Only variables declared with Dim or Var at the beginning can allow "run-time constants" like the address of a string literal.
by dkl
Feb 10, 2017 20:38
Forum: General
Topic: Any reason for not allowing dim byref in UDT?
Replies: 20
Views: 1553

Re: Any reason for not allowing dim byref in UDT?

Unfortunately there is no way to ensure that besides being careful. Just like pointers, references can be dangling. The only way to prevent that would be to use a language where all objects are reference counted and garbage collected, or disallow references/pointers to things that can disappear.

Go to advanced search