Guys, please, I'm trying to figure out why the following code is crashing only with Logic MAC 64 bits version. EnergyXT 32 bits MAC works. And Windows both 32 and 64 bits works.
The code is trying to load a WusikSND file, 16 bits and 2 Channels (Stereo).
Sadly I don't have Logic to debug, only eXT and it works without problems. Is there any VST/AU free 64 bit native host I could use on the MAC?
I was wondering on the tHeader structure, if somehow is translating wrong for MAC 64 bit native. Another thing would be the way I'm using HeapBlock, but it works on Win 32/64 and MAC 32... so I'm not sure.
Well obviously a struct containing longs will be a completely different layout on 64 vs 32 bits. Don't know if that's your problem but if you're defining a cross-platform struct you must use types that have a known size, and define the packing explicitly.
Some nasty coding habits in there, William! You need to get your head around RAII - deleteAndZero is just not how smart people manage their objects. And there's a lot of D.R.Ying that could be done. Not to mention basic security things like checking that your read() calls actually succeeded before working with possibly uninitialised data (!). And replace those tab characters with spaces (yuck!)
Thanks Jules. The only thing I don't know about is explicit packing, so I have to check that. Well, no idea on what you are talking about related to Tabs, as MSVC is doing all this on its own, but I will check things out when possible.