Morten Ofstad
2004-Oct-19 10:16 UTC
[LLVMdev] Visual C Patches for IsNAN.cpp and IsInf.cpp
I don't know if Paolo submitted his patches for these files, but they are not in the CVS -- I've chosen a slightly different strategy, adding a case that checks if the compiler is MSVC instead of adding HAVE_FINITE_IN_FLOAT_H and HAVE_ISNAN_IN_FLOAT_H to the config.h file. I don't know which is the best approach, but this is the minimal patch to make it work... m. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diff.txt URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041019/e3766cfc/attachment.txt>
Paolo Invernizzi
2004-Oct-19 10:32 UTC
[LLVMdev] Visual C Patches for IsNAN.cpp and IsInf.cpp
I submitted a patch keeping the traditional approach, HAVE_FINITE_IN_FLOAT_H and HAVE_ISNAN_IN_FLOAT... Just another case added to the others instead of a custom approach. --- Paolo On Oct 19, 2004, at 12:16 PM, Morten Ofstad wrote:> I don't know if Paolo submitted his patches for these files, but they > are not in the CVS -- I've chosen a slightly different strategy, > adding a case that checks if the compiler is MSVC instead of adding > HAVE_FINITE_IN_FLOAT_H and HAVE_ISNAN_IN_FLOAT_H to the config.h file. > > I don't know which is the best approach, but this is the minimal patch > to make it work... > > m. > > Index: lib/Support/IsNAN.cpp > ==================================================================> RCS file: /var/cvs/llvm/llvm/lib/Support/IsNAN.cpp,v > retrieving revision 1.2 > diff -u -r1.2 IsNAN.cpp > --- lib/Support/IsNAN.cpp 1 Sep 2004 22:55:35 -0000 1.2 > +++ lib/Support/IsNAN.cpp 19 Oct 2004 10:11:39 -0000 > @@ -19,6 +19,9 @@ > #elif HAVE_STD_ISNAN_IN_CMATH > # include <cmath> > using std::isnan; > +#elif defined(_MSC_VER) > +#include <float.h> > +#define isnan _isnan > #else > # error "Don't know how to get isnan()" > #endif > Index: lib/Support/IsInf.cpp > ==================================================================> RCS file: /var/cvs/llvm/llvm/lib/Support/IsInf.cpp,v > retrieving revision 1.3 > diff -u -r1.3 IsInf.cpp > --- lib/Support/IsInf.cpp 1 Sep 2004 22:55:35 -0000 1.3 > +++ lib/Support/IsInf.cpp 19 Oct 2004 10:11:39 -0000 > @@ -24,6 +24,9 @@ > // apparently this has been a problem with Solaris for years. > # include <ieeefp.h> > static int isinf(double x) { return !finite(x) && x==x; } > +#elif defined(_MSC_VER) > +#include <float.h> > +#define isinf !_finite > #else > # error "Don't know how to get isinf()" > #endif > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
Morten Ofstad
2004-Oct-19 11:10 UTC
[LLVMdev] Visual C Patches for IsNAN.cpp and IsInf.cpp
Paolo Invernizzi wrote:> I submitted a patch keeping the traditional approach, > HAVE_FINITE_IN_FLOAT_H and HAVE_ISNAN_IN_FLOAT... > Just another case added to the others instead of a custom approach.It's a bit clumsy to do the configuration when you can't run the configure script, but I don't really mind either way. As long as one of the patches goes in as soon as possible and I know which one, I'm happy... m.
Possibly Parallel Threads
- [LLVMdev] Visual C Patches for IsNAN.cpp and IsInf.cpp
- [LLVMdev] IsNAN.cpp:23:3: #error "Don't know how to get isnan()"
- [LLVMdev] Compiling LLVM under vista with msdev 2008 gives a few errors
- [LLVMdev] HowToUseJIT.cpp - file: 'llvm/ADT/iterator': No such file or directory
- [LLVMdev] Compiling LLVM under vista with msdev 2008 gives a few errors