Juce::powf vs math.h


#1

Hi im trying to test my app on MacOSX Intel, MacOSX PPC and Linux and Im having a problem on PPC with the juce math functions (juce::powf , juce::expf and so on) shadowing the ones in <Math.h>

Specifically, if my code references ‘juce::powf’, then it breaks on Linux and MacIntel, but if i use just ‘powf’ without a namespace then it breaks on PPC. Im pretty new to c++ and im sure there is something about namespaces that im not understandin but i dont see how to fix this… I tried using ‘std::powf’ in my code but the complier didnt like that, and then I tried rebuilding my libjuce.dylib with no ‘_ppc’ macros defined in juce.xcconfig but this hasnt helped. Any suggestions about the correct way to use these functions appreciated!

best, Rick Taube


#2

This was always a problem because it seemed that every release of MacOS moved those functions around or changed them. I thought I’d finally got it right under at least 10.2 and 10.4

The best approach might be to use some #defines to map each platform to the right type of call…


#3