freebasic / fbc

FreeBASIC is a completely free, open-source, multi-platform BASIC compiler, with syntax similar to MS-QuickBASIC, that adds new features such as pointers, object orientation, unsigned data types, inline assembly, and many others.
https://www.freebasic.net
877 stars 137 forks source link

various argument errors attempting to use curses.bi on linux #363

Open BlameTroi opened 2 years ago

BlameTroi commented 2 years ago

fbc 1.09.0 2022-02-16

I can't see a problem in the definitions for the various mvaddxxx functions and macros in ncurses.bi. decomposing the calls into equivalent move and add functions works. Example:

' attempting to do some quick curses work

include once "curses.bi"

initscr() move(0, 0) addstr("This string gets printed at position (0, 0)") mvaddstr(1, 0, "and this should be at position (1, 0)") refresh() napms(3000) endwin()

Gets an error when compiled:

Invalid data types in 'mvaddstr(1, 0, "and this should be at position (1, 0)")'

curses.bi and so on are all from the install.

fbc -showincludes curses.bas curses.bas | /usr/include/freebasic/curses.bi | | /usr/include/freebasic/curses/ncurses.bi | | | /usr/include/freebasic/crt/long.bi | | | /usr/include/freebasic/crt/stdio.bi | | | | (/usr/include/freebasic/crt/long.bi) | | | | /usr/include/freebasic/crt/stddef.bi | | | | /usr/include/freebasic/crt/stdarg.bi | | | | /usr/include/freebasic/crt/linux/stdio.bi | | | (/usr/include/freebasic/crt/stdarg.bi)

I'm stumped.

rversteegen commented 2 years ago

I've reduced this to a minimal testcase:

iif(0,0,0)

All the mvw* functions expand to an iif.