I just updated my JUCE code to include this commit:
and I’m getting a compile time error I wasn’t getting before with Visual Studio 2015 (XCode is fine)…
1>c:\users\railjonrogut\documents\juceprojects\railfork2\jucelibrarycode\modules\juce_core\memory\juce_byteorder.h(203): error C2131: expression did not evaluate to a constant
1> c:\users\railjonrogut\documents\juceprojects\railfork2\jucelibrarycode\modules\juce_core\memory\juce_byteorder.h(203): note: failure was caused by out of range index 5; allowed range is 0 <= index < 5
1>c:\users\railjonrogut\documents\juceprojects\railfork2\jucelibrarycode\modules\juce_core\memory\juce_byteorder.h(204): error C2131: expression did not evaluate to a constant
1> c:\users\railjonrogut\documents\juceprojects\railfork2\jucelibrarycode\modules\juce_core\memory\juce_byteorder.h(204): note: failure was caused by out of range index 7; allowed range is 0 <= index < 7
To make a 64-bit integer, it obviously expects an 8-byte block of memory, but you’re only giving it a 5-byte literal, so the compiler’s totally correct about it being wrong!
Are you sure other compilers don’t also throw an error??
auto fileHeader = (int64) ByteOrder::littleEndianInt64 ("RAWFLT");
fixes the problem.
I noticed the FLAX issue… but I’m not using the header variable in the code, so I dropped that from the code – changing it to an int and using littleEndianInt() gave the same issue BTW. I had no issues with Xcode.
Hmm, I’m sceptical about that. The error is very clearly saying that you’ve given it too little data. Maybe you fixed one place where you did this, but still had others in your codebase which also triggered the same thing?
Right – I did a clean and added the “flaX…” back in and it compiles fine.
This is a separate JUCE project in the solution and is used in my custom module… I searched the code for all occurrences… and when I dropped the flaX line and switched the other to auto it compiles without error.
I’m not actually using the FloatAudioFormat in my plug-in… so changing the line to auto will let me compile, but I won’t be able to ascertain if there are any ill affects right away. I suspect I’ll need to add spaces for the (int64) ByteOrder::littleEndianInt64 (“RAWFLT…”) too.