(WIN) Add special 64bit remarks...

BlitzMax Forums/BlitzMax NG/(WIN) Add special 64bit remarks...

Fielder(Posted 2016) [#1]
to adapt applications to 64 bit compilation some part of code need to be REMARKED... i've not find something like:

?Win64
  'code64
?Win32
  'code32
?


maybe it's hard to add this feature.. but maybe it's possible to add something like that: (looking at the double rem ' )

''64 print "this line is executed on 64 bit compilation"


and use some sort of Pre-Compiler that PARSE the source creating the right source for 64 compiling...

the use of the double rem --> '' can make the source compatible with old IDES.. and 32 bit stock compiler...


Derron(Posted 2016) [#2]
For now you are able to use:


debug
threaded
macos
macosx86
macosppc
macosx64
osx
osxx86
osxppc
osxx64
ios
iosx86
iosx64
iosarmv7
iosarm64
win32
win32x86
win32x64
win64
linux
linuxx86
linuxx64
linuxarm
android
androidx86
androidx64
androidarm
androidarmeabi
androidarmeabiv7a
androidarm64v8a
raspberrypi
raspberrypiARM
emscripten
emscriptenjs
ppc
x86
x64
arm
armeabi
armeabiv7a
arm64v8a
js
armv7
arm64
ptr32
ptr64
bigendian
littleendian
opengles
musl
bmxng




With NG you could also mix conditionals with normal expressions:
?linux or win64
- evaluates the following if either "linux" (32 or 64 ...does not matter) or win64


@ Preprocessor
When compiling with the NG chain (bmk/bcc) you could use the project specific pre.bmk (place it in the projects folder) and this lua file is executed before. It could adjust source files if needed. This is of course no preprocessor as you want it, but might help out in certain situations.

bye
Ron


Fielder(Posted 2016) [#3]
OMG really? thank you!

but how to manage this?
?MacOS
Import BRL.glmax2d
Import brl.freeaudioaudio
?Win32
Import brl.d3d9max2d
Import brl.directsoundaudio
Import "test.o"
Import its.printing
?win64
Import brl.d3d9max2d
Import brl.directsoundaudio
?Linux
Import BRL.glmax2d
Import brl.freeaudioaudio
Import "-ldl"
?

compiling on WIN for WIN64 i receive and error:
can't find interface for module "its.printing"
but this module is only loaded on win32...


Derron(Posted 2016) [#4]
Edited my previous post while you replied, so you might miss my preprocessor-appendix.


bye
Ron


Fielder(Posted 2016) [#5]
i tried this:
?MacOS
Import BRL.glmax2d
Import brl.freeaudioaudio
?Win32x86
Import brl.d3d9max2d
Import brl.directsoundaudio
Import "test.o"
Import its.printing
?win32x64
Import brl.d3d9max2d
Import brl.directsoundaudio
?Linux
Import BRL.glmax2d
Import brl.freeaudioaudio
Import "-ldl"
?

and WORKS on NG...
but what about using this source on standard Blitzmax (where ?Win32x86 and ?win32x64) doesn't exist? (or these commands exist?)

what can i do to make source compatible with NG and standard version of Blitzmax?

i've to do that? :
?MacOS
Import BRL.glmax2d
Import brl.freeaudioaudio
?Win32
Import brl.d3d9max2d
Import brl.directsoundaudio
Import "test.o"
Import its.printing
?Win32x86
Import brl.d3d9max2d
Import brl.directsoundaudio
Import "test.o"
Import its.printing
?win32x64
Import brl.d3d9max2d
Import brl.directsoundaudio
?Linux
Import BRL.glmax2d
Import brl.freeaudioaudio
Import "-ldl"
?



Derron(Posted 2016) [#6]
A non-existing conditional in vanilla is always "false", so not executed.

To make them work with BOTH, I had to split it into multiple files for my framework:


?Win32
Import "thisveryfile_win32.bmx"
?not win32
...
?

in that "thisveryfile_win32.bmx" I could do
?bmxng
...
?not bmxng
...
?


So in your case you could do similar. I know it is not comfortable but it allows to keep a certain level of backwards-compatibility.


In your case it would be by the way:
?win32
Import "myfile_win32.bmx"
?Linux
...

and myfile_win32.bmx then contains:
?not win32x64 'this is true on vanilla - double negation
...import the x86 files
?win32x64 'only true on NG and when 64bit
... import the x64 files
?


bye
Ron


Brucey(Posted 2016) [#7]
win32x86 is a valid option in legacy bcc.