Clean up some header files and fix compilation with MSC.
authorRichard Kreckel <kreckel@ginac.de>
Sun, 6 Nov 2016 18:35:46 +0000 (19:35 +0100)
committerRichard Kreckel <kreckel@ginac.de>
Sun, 6 Nov 2016 18:35:46 +0000 (19:35 +0100)
On MSC there is no <unistd.h>. It turns out that we need to #include <io.h>
in order to use close(3). This fixes the build failure introduced in 8305ec38.

Thanks to Jan Rheinländer for reporting this.

acinclude.m4
check/mul_eval_memleak.cpp
check/timer.cpp
ginac/excompiler.cpp

index 0b6db8c..53b45e5 100644 (file)
@@ -34,7 +34,6 @@ AC_CACHE_CHECK([for standard C++ header files], [ginac_cv_std_cxx_headers], [
                #include <cstdio>
                #include <cstdlib>
                #include <cstring>
-               #include <cstddef>
                #include <cstdint>
                #include <ctime>
                #include <fstream>
index 7a349e8..4ddc2e2 100644 (file)
@@ -96,7 +96,6 @@ g(1301*scale^(-1)))*eps^(-1)+F))\
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
-#include <unistd.h>
 
 static void set_VM_limit(const unsigned long MB) {
        const unsigned mem_lim_kb = MB*1024*1024;
index 01a7c79..46d173f 100644 (file)
@@ -22,7 +22,6 @@
 
 #ifdef HAVE_RUSAGE
 #include <sys/resource.h>
-#include <unistd.h>
 #include <sys/time.h>
 #else
 #include <ctime>
index 6b1ae4c..0492015 100644 (file)
 #include "symbol.h"
 
 #ifdef HAVE_LIBDL
-#include <dlfcn.h>
+# include <dlfcn.h>
 #endif // def HAVE_LIBDL
-#include <unistd.h>
-#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#else
+# ifdef _MSC_VER
+#  include <io.h>  // for close(3)
+# endif // def _MSC_VER
+#endif // def HAVE_UNISTD_H
+#include <cstdlib>
 #include <fstream>
 #include <ios>
 #include <sstream>