There is no way to write one single piece of code that is going to compile on both a Win32 and Linux system.
I did it with ubx with just one CONSTANT (#define).
Okay, I should have been more clear.
I never was writing a strictly
console mode app.
Much of Bxbasic (interpreter) is built upon a blend of C Library (console) and win32 console mode utilities and functions.
I took the same approach in designing Bxbasm: "I used from
all available parts".
I pretty much figured that if the Win32 API has a function called "foo.api" and I use it for its intended purpose, (for simplicity, let's say to clear the screen, for instance), then Linux must have a corresponding function, maybe its called: koo.??, or poo.??, or boo.??, or
.??, that clears the screen.
Simple..., you do a
one for
one switch.
I must be in error.
I must have assumed too much.
There are big differences in console/terminal manipulation code( pos,locate,color...) as Linux uses escape sequences (ala old dos)
where with windows you do need the winapi.
From what I'm gathering, I may have to approach Linux programming more like programming MS-DOS.
Does Linux use an API, or do you call interrupts and ANSI.SYS functions, like DOS ?
I have the code if you want it when you reach that stage but first I think you need to create code that only uses the standard "c" libraries.
Well, (in my opinion), to change Bxbasm to the point that: "you need to create code that only uses the standard "c" libraries", would seriously be a step backwards.
Now, that said, what I can do is to make a modified version, specifically for a Linux port, that "only uses the standard "c" libraries".
It will be devoid of some existing functionality.
I already know what some of that will be, as I used win32 API functions to create that functionality.
I'll see what I can do and what we end up with.
Let you know, soon.