Changeset: 4fb8e8ea0e3c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4fb8e8ea0e3c
Modified Files:
        NT/monetdb_config.h.in
        configure.ag
        gdk/gdk_aggr.c
        gdk/gdk_atoms.c
        gdk/gdk_atoms.h
        geom/monetdb5/geom.c
        monetdb5/extras/rapi/converters.c.h
        monetdb5/modules/kernel/mmath.c
        monetdb5/modules/kernel/mmath.h
        sql/backends/monet5/UDF/pyapi/convert_loops.h
        sql/backends/monet5/UDF/pyapi/type_conversion.c
Branch: default
Log Message:

Some cleanup + get this to compile with the Intel compiler on Windows.


diffs (210 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -235,11 +235,6 @@
 /* Define to 1 if you have the <io.h> header file. */
 #define HAVE_IO_H 1
 
-/* Define to 1 if you have the `isinf' function. */
-#if !defined(_MSC_VER) || _MSC_VER > 1600
-#define HAVE_ISINF 1
-#endif
-
 /* Define to 1 if you have the <kvm.h> header file. */
 /* #undef HAVE_KVM_H */
 
@@ -367,7 +362,7 @@
 /* #undef HAVE_NL_LANGINFO */
 
 /* Define to 1 if you have the `nextafterf' function. */
-#if !defined(_MSC_VER) || _MSC_VER > 1600
+#if defined(__INTEL_COMPILER) || !defined(_MSC_VER) || _MSC_VER > 1600
 #define HAVE_NEXTAFTERF 1
 #endif
 
@@ -428,7 +423,7 @@
 /* #undef HAVE_RESTRICT */
 
 /* Define to 1 if you have the `round' function. */
-#if !defined(_MSC_VER) || _MSC_VER > 1600
+#if defined(__INTEL_COMPILER) || !defined(_MSC_VER) || _MSC_VER > 1600
 #define HAVE_ROUND 1
 #endif
 
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2730,7 +2730,6 @@ AC_CHECK_FUNCS([\
        getopt_long \
        gettimeofday \
        getuid \
-       isinf \
        llabs \
        localtime_r \
        lockf \
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -151,13 +151,6 @@ BATgroupaggrinit(BAT *b, BAT *g, BAT *e,
 /* ---------------------------------------------------------------------- */
 /* sum */
 
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && _MSC_VER < 1800
-#include <float.h>
-#define isnan(x)       _isnan(x)
-#define isinf(x)       (_fpclass(x) & (_FPCLASS_NINF | _FPCLASS_PINF))
-#define isfinite(x)    _finite(x)
-#endif
-
 static inline int
 samesign(double x, double y)
 {
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -23,18 +23,9 @@
 #include "monetdb_config.h"
 #include "gdk.h"
 #include "gdk_private.h"
-#if defined(_MSC_VER) && defined(__INTEL_COMPILER)
-#include <mathimf.h>                   /* Intel compiler on Windows */
-#else
-#include <math.h>                              /* anywhere else */
-#endif
 
-/* these are only for older Visual Studio compilers (VS 2010) */
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && _MSC_VER < 1800
-#include <float.h>
-#define isnan(x)       _isnan(x)
-#define isinf(x)       (_fpclass(x) & (_FPCLASS_NINF | _FPCLASS_PINF))
-#define isfinite(x)    _finite(x)
+#ifndef NAN
+#define NAN            ((float)(((float)(1e300 * 1e300)) * 0.0F))
 #endif
 
 /* the *Cmp functions return a value less than zero if the first
diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h
--- a/gdk/gdk_atoms.h
+++ b/gdk/gdk_atoms.h
@@ -154,7 +154,10 @@ gdk_export const ptr ptr_nil;
 #endif
 
 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && _MSC_VER < 1800
+#include <float.h>
 #define isnan(x)       _isnan(x)
+#define isinf(x)       (_fpclass(x) & (_FPCLASS_NINF | _FPCLASS_PINF))
+#define isfinite(x)    _finite(x)
 #endif
 
 /*
diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -14,10 +14,6 @@
 #include "geom.h"
 #include "mal_exception.h"
 
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && _MSC_VER < 1800
-#define isnan(x)       _isnan(x)
-#endif
-
 int TYPE_mbr;
 
 static wkb *geos2wkb(const GEOSGeometry *geosGeometry);
diff --git a/monetdb5/extras/rapi/converters.c.h 
b/monetdb5/extras/rapi/converters.c.h
--- a/monetdb5/extras/rapi/converters.c.h
+++ b/monetdb5/extras/rapi/converters.c.h
@@ -187,7 +187,7 @@ static BAT* sexp_to_bat(SEXP s, int type
                if (!IS_NUMERIC(s)) {
                        return NULL;
                }
-               SXP_TO_BAT(dbl, NUMERIC_POINTER, (ISNA(*p) || MNisnan(*p) || 
MNisinf(*p)));
+               SXP_TO_BAT(dbl, NUMERIC_POINTER, (ISNA(*p) || isnan(*p) || 
isinf(*p)));
                break;
        }
        case TYPE_str: {
diff --git a/monetdb5/modules/kernel/mmath.c b/monetdb5/modules/kernel/mmath.c
--- a/monetdb5/modules/kernel/mmath.c
+++ b/monetdb5/modules/kernel/mmath.c
@@ -187,7 +187,7 @@ MATHunary_ISNAN(bit *res, const dbl *a)
        if (is_dbl_nil(*a)) {
                *res = bit_nil;
        } else {
-               *res = MNisnan(*a);
+               *res = isnan(*a);
        }
        return MAL_SUCCEED;
 }
@@ -198,7 +198,7 @@ MATHunary_ISINF(int *res, const dbl *a)
        if (is_dbl_nil(*a)) {
                *res = int_nil;
        } else {
-               if (MNisinf(*a)) {
+               if (isinf(*a)) {
                        *res = (*a < 0.0) ? -1 : 1;
                } else {
                        *res = 0;
@@ -213,7 +213,7 @@ MATHunary_FINITE(bit *res, const dbl *a)
        if (is_dbl_nil(*a)) {
                *res = bit_nil;
        } else {
-               *res = MNfinite(*a);
+               *res = isfinite(*a);
        }
        return MAL_SUCCEED;
 }
diff --git a/monetdb5/modules/kernel/mmath.h b/monetdb5/modules/kernel/mmath.h
--- a/monetdb5/modules/kernel/mmath.h
+++ b/monetdb5/modules/kernel/mmath.h
@@ -10,23 +10,6 @@
 #define __MMATH_H__
 #include "mal.h"
 #include "mal_exception.h"
-#if defined(_MSC_VER) && defined(__INTEL_COMPILER)
-#include <mathimf.h>                   /* Intel compiler on Windows */
-#else
-#include <math.h>                              /* anywhere else */
-#endif
-
-/* these are only for older Visual Studio compilers (VS 2010) */
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && _MSC_VER < 1800
-#include <float.h>
-#define isnan(x)       _isnan(x)
-#define isinf(x)       (_fpclass(x) & (_FPCLASS_NINF | _FPCLASS_PINF))
-#define isfinite(x)    _finite(x)
-#endif
-
-#define MNisnan(x)     isnan(x)
-#define MNfinite(x)    isfinite(x)
-#define MNisinf(x)     isinf(x)
 
 #define unopbaseM5_export(X1,X2)\
 mal_export str MATHunary##X1##X2(X2 *res, const X2 *a);
diff --git a/sql/backends/monet5/UDF/pyapi/convert_loops.h 
b/sql/backends/monet5/UDF/pyapi/convert_loops.h
--- a/sql/backends/monet5/UDF/pyapi/convert_loops.h
+++ b/sql/backends/monet5/UDF/pyapi/convert_loops.h
@@ -29,10 +29,6 @@
 // 'bat' is a BAT* pointer, which will contain the new BAT. TYPE_'mtpe' is the
 // BAT type, and 'batstore' is the heap storage type of the BAT (this should be
 // STORE_CMEM or STORE_SHARED)
-#if defined(_MSC_VER) && _MSC_VER <= 1600
-#define isnan(x) _isnan(x)
-#endif
-
 #define nancheck_flt(bat)                                                      
\
        do {                                                                    
   \
                for (iu = 0; iu < ret->count; iu++) {                           
       \
diff --git a/sql/backends/monet5/UDF/pyapi/type_conversion.c 
b/sql/backends/monet5/UDF/pyapi/type_conversion.c
--- a/sql/backends/monet5/UDF/pyapi/type_conversion.c
+++ b/sql/backends/monet5/UDF/pyapi/type_conversion.c
@@ -12,10 +12,6 @@
 
 #include <longintrepr.h>
 
-#if defined(_MSC_VER) && _MSC_VER <= 1600
-#define isnan(x) _isnan(x)
-#endif
-
 #if PY_MAJOR_VERSION >= 3
 #define IS_PY3K
 #define PyInt_Check PyLong_Check
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to