Wouldn't it be...
#if !defined(_MSC_VER) || (_MSC_VER >= 17000))
i.e., always true unlese we're MSVC and < 17000 ?
(I think the line below would stop it from being compiled in with mingw).
cheers
Miller
On Sat, Jul 22, 2017 at 12:35:23AM +0200, Dan Wilcox wrote:
Simplest fix is to replace the
#ifndef _WIN32
with
#if !defined(_WIN32) || (defined(_MSC_VER) && (_MSC_VER >= 17000))
I think that is pretty safe and can be added now without any real issues. If Pd is compiled with a newer MSVC than 2008, boom those are available.
Another, longer & probably more difficult option, is to provide implementations for MSVC < 2012 such as:
// versions of MSVC prior to 2012 do not have these
#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 17000)
#define asinh(x) log(x + sqrt(x2 + 1))
#define acosh(x) log(x + sqrt(x2 - 1))
#define atanh(x) (log(1+x) - log(1-x))/2
#define isnan(x) _isnan(x)
#define isinf(x) (!_finite(x))
...
#endif
I have no idea exactly how express calls the root C functions, so this approach may not work anyway.
On Jul 21, 2017, at 10:39 PM, Miller Puckette <msp@ucsd.edu> wrote:
OK, will try that for next release :)
Anyhow, I have to profile MSVC against mingw and (hopefully) move the
whole compile chain over. But certainly not now.
Miller
On Fri, Jul 21, 2017 at 10:30:26PM +0200, Dan Wilcox wrote:
Looks like the preprocessor define is _MSC_VER: https://stackoverflow.com/questions/70013/how-to-detect-if-im-compiling-code-with-visual-studio-2008 <https://stackoverflow.com/questions/70013/how-to-detect-if-im-compiling-code-with-visual-studio-2008>
So something like the following could probably work:
#ifdef _WIN32
#if (_MSC_VER < 17000)
#define ATANH_NOT_AVAILABLE
#endif
#endif
#include <math.h>
On Jul 21, 2017, at 10:21 PM, Dan Wilcox <danomatika@gmail.com> wrote:
It's most probably working because you are compiling on a newer system with a newer Visual Studio which has the newer math.h which has the function.
Older versions pre-2012 do not, hence the current non-usage.
On Jul 21, 2017, at 9:55 PM, Alexandre Torres Porres <porres@gmail.com <mailto:porres@gmail.com>> wrote:
2017-07-21 16:44 GMT-03:00 Dan Wilcox <danomatika@gmail.com <mailto:danomatika@gmail.com>>:
Those functions are in the windows math.h if you're using Visual Studio 2012 or greater.
Hey, I just realized we have an [atanh] object for cyclone, I actually did that one myself, and I just tested, it's working on windows!
here's the source https://github.com/porres/pd-cyclone/blob/master/cyclone_src/binaries/control/atanh.c <https://github.com/porres/pd-cyclone/blob/master/cyclone_src/binaries/control/atanh.c>
so, definitely, those functions may exist for windows, not sure what building system you're using, but it may need an update
--------
Dan Wilcox
@danomatika <http://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>
--------
Dan Wilcox
@danomatika <http://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>
--------
Dan Wilcox
@danomatika <http://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>