Unofficial FreeBASIC 1.04.0 OS X release

For other topics related to the FreeBASIC project or its community.
srvaldez
Posts: 2007
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Postby srvaldez » Oct 03, 2017 16:49

hello TeeEmCee
there's one anomaly with FB on my Mac and that is that it does not accept input from the numeric keypad unless I first press the clear key which is the num key on a Windows keyboard and neither does it accept a delete (backspace?)
is there a way to turn the numeric keypad on at runtime?
also I have not found a way to delete a character from user input, the delete key causes the curser to jump up about 3 lines.
btw, on OS X Lion there were no such problems.
srvaldez
Posts: 2007
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Postby srvaldez » Oct 03, 2017 17:28

how can I build FB so that it will not give me this warnings
ld: warning: object file (/usr/local/lib/freebasic/darwin-x86_64/libfb.a(con_input.o)) was built for newer OSX version (10.13) than being linked (10.4)

never mind, it was hardcoded in fbc.bas I changed it to my current os version and no more ld warnings.
Last edited by srvaldez on Oct 03, 2017 18:47, edited 1 time in total.
srvaldez
Posts: 2007
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Postby srvaldez » Oct 03, 2017 17:37

also when building FB there's this warning
src/gfxlib2/unix/gfx_x11.c:584:68: warning: incompatible pointer types passing 'KeySym *(Display *, unsigned int, int, int *)'
(aka 'unsigned long *(struct _XDisplay *, unsigned int, int, int *)') to parameter of type 'XGETKEYBOARDMAPPING' (aka
'unsigned long *(*)(struct _XDisplay *, unsigned char, int, int *)') [-Wincompatible-pointer-types]
fb_hInitX11KeycodeToScancodeTb( fb_x11.display, XDisplayKeycodes, XGetKeyboardMapping, XFree );
^~~~~~~~~~~~~~~~~~~
src/gfxlib2/unix/../../rtlib/unix/fb_private_scancodes_x11.h:19:23: note: passing argument to parameter 'GetKeyboardMapping' here
XGETKEYBOARDMAPPING GetKeyboardMapping,
^
1 warning generated.

I suspect that it may be the root of my keyboard problems.
I am using this FB branch https://github.com/rversteegen/fbc/tree ... 8132d23bbd
TeeEmCee
Posts: 250
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Unofficial FreeBASIC 1.04.0 OS X release

Postby TeeEmCee » Oct 04, 2017 16:04

Yikes, that looks like a serious error; I wonder what's happening there? I fear it's some change in the X11 headers on OSX.

I don't have access to my mac at the moment.

srvaldez wrote:
ld: warning: object file (/usr/local/lib/freebasic/darwin-x86_64/libfb.a(con_input.o)) was built for newer OSX version (10.13) than being linked (10.4)

never mind, it was hardcoded in fbc.bas I changed it to my current os version and no more ld warnings.

Probably we should add a commandline argument to fbc to specify the OSX version to target instead of hardcoding one, because there is no version we can target that isn't going to cause problems (I still target OSX 10.4 when compiling, though I haven't heard from anyone using it for a while. Though I have a proportionally large amount of Mac users, because there are few game engines that work on MacOS)
dkl
Site Admin
Posts: 3207
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Unofficial FreeBASIC 1.04.0 OS X release

Postby dkl » Oct 04, 2017 17:43

It looks like XGetKeyboardMapping()'s second parameter (keycode_entry) is an "unsigned int" instead of "KeyCode aka. unsigned char" as expected by FB's XGETKEYBOARDMAPPING typedef. The declaration here looks like

Code: Select all

extern KeySym *XGetKeyboardMapping(
    Display*      /* display */,
#if NeedWidePrototypes
    unsigned int   /* first_keycode */,
#else
    KeyCode      /* first_keycode */,
#endif
    int         /* keycode_count */,
    int*      /* keysyms_per_keycode_return */
);

I don't know what NeedWidePrototypes is there for, but apparently it's enabled in your case. Best thing may be to adjust FB to respect the NeedWidePrototypes option and adjust its typedefs based on that.

Using -Werror can help a lot to force finding and fixing such problems.
config.mk wrote:FBFLAGS := -g -exx -maxerr 1
CFLAGS := -g -O2 -Werror -Wfatal-errors -DDEBUG
srvaldez
Posts: 2007
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Postby srvaldez » Oct 04, 2017 17:51

thank you dkl and TeeEmCee :-)

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests