summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2016-01-21 18:13:54 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2016-01-21 18:20:44 +0800
commit2ae18d05e654b1130fa7397b316d270be1707450 (patch)
tree536856f90b7db50224cbd113f144a647410186e9 /build
parenta12e7b90e7b9fa6a6a325f39fb409722b06a6735 (diff)
downloadlibrsvg-2ae18d05e654b1130fa7397b316d270be1707450.tar.gz
Visual Studio builds: Fix pre-Visual Studio 2012 builds
A recent commit made use of the C99 function isnan(), which is not supported directly in pre-2013 Visual Studio. Earlier Visual Studio however does provide _isnan() which does what we will need, so add a fallback math.h in build/win32/vs9 that defines isnan() and includes the stock math.h, and make the projects include this math.h. This header is copied to the build/win32/vs[10|11] during 'make dist', as Visual Studio 2010 and 2012 will need this as well.
Diffstat (limited to 'build')
-rw-r--r--build/win32/vs10/Makefile.am6
-rw-r--r--build/win32/vs10/rsvg-build-defines.props2
-rw-r--r--build/win32/vs11/Makefile.am6
-rw-r--r--build/win32/vs9/Makefile.am1
-rw-r--r--build/win32/vs9/math.h39
-rw-r--r--build/win32/vs9/rsvg-build-defines.vsprops2
6 files changed, 52 insertions, 4 deletions
diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am
index 47196832..0295b7cc 100644
--- a/build/win32/vs10/Makefile.am
+++ b/build/win32/vs10/Makefile.am
@@ -3,7 +3,8 @@ GENERATED_ITEMS = \
rsvg.vcxproj.filters \
rsvg-convert.vcxproj \
rsvg-convert.vcxproj.filters \
- rsvg-install.props
+ rsvg-install.props \
+ math.h
EXTRA_DIST = \
librsvg.sln \
@@ -27,6 +28,9 @@ rsvg-install.props: $(top_srcdir)/build/win32/vs10/rsvg-install.propsin rsvg.vs1
$(CPP) -P - <$(top_srcdir)/build/win32/vs10/rsvg-install.propsin >$@
rm rsvg.vs10.headers
+math.h: $(top_srcdir)/build/win32/vs9/math.h
+ cp $< $@
+
DISTCLEANFILES = $(GENERATED_ITEMS)
-include $(top_srcdir)/git.mk
diff --git a/build/win32/vs10/rsvg-build-defines.props b/build/win32/vs10/rsvg-build-defines.props
index d8194250..45d70f6b 100644
--- a/build/win32/vs10/rsvg-build-defines.props
+++ b/build/win32/vs10/rsvg-build-defines.props
@@ -5,7 +5,7 @@
</ImportGroup>
<PropertyGroup Label="UserMacros">
<LibRsvgCFlags>G_LOG_DOMAIN="librsvg";RSVG_DISABLE_DEPRECATION_WARNINGS;RSVG_COMPILATION</LibRsvgCFlags>
- <LibRsvgIncPath>$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\libcroco-0.6;$(GlibEtcInstallRoot)\include\libxml2</LibRsvgIncPath>
+ <LibRsvgIncPath>$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\libcroco-0.6;$(GlibEtcInstallRoot)\include\libxml2;.\</LibRsvgIncPath>
<LibRsvgLibs>pangocairo-1.0.lib;pango-1.0.lib;croco-0.6.lib;libxml2.lib</LibRsvgLibs>
<IntlLib>intl.lib</IntlLib>
<Gtk3IncPath>$(GlibEtcInstallRoot)\include\gtk-3.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(LibRsvgIncPath)</Gtk3IncPath>
diff --git a/build/win32/vs11/Makefile.am b/build/win32/vs11/Makefile.am
index 3314824c..95d1a20a 100644
--- a/build/win32/vs11/Makefile.am
+++ b/build/win32/vs11/Makefile.am
@@ -13,7 +13,8 @@ EXTRA_DIST = \
rsvg-install.vcxproj \
rsvg-view-3.vcxproj \
rsvg-view-3.vcxproj.filters \
- README.txt
+ README.txt \
+ math.h
DISTCLEANFILES = $(EXTRA_DIST)
@@ -22,3 +23,6 @@ MSVC_FORMAT_VER = 12
MSVC_VER_LONG = 2012
include $(top_srcdir)/build/Makefile-newvs.am
+
+math.h: $(top_srcdir)/build/win32/vs9/math.h
+ cp $< $@
diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am
index 56a81dc6..1a674044 100644
--- a/build/win32/vs9/Makefile.am
+++ b/build/win32/vs9/Makefile.am
@@ -15,6 +15,7 @@ EXTRA_DIST = \
rsvg-install.vcproj \
rsvg-view-3.vcproj \
README.txt \
+ math.h \
$(GENERATED_ITEMS)
rsvg-install.vsprops: $(top_srcdir)/build/win32/vs9/rsvg-install.vspropsin rsvg.headers
diff --git a/build/win32/vs9/math.h b/build/win32/vs9/math.h
new file mode 100644
index 00000000..f4f0c89d
--- /dev/null
+++ b/build/win32/vs9/math.h
@@ -0,0 +1,39 @@
+/* librsvg - SVG rendering library
+ * Copyright (C) 2015 Chun-wei Fan <fanc999@yahoo.com.tw>
+ *
+ * Author: Chun-wei Fan <fanc999@yahoo.com.tw>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <float.h>
+
+/* include the system's math.h */
+#include <../include/math.h>
+#include <glib.h>
+
+#if (_MSC_VER < 1800)
+/* it seems of the supported compilers only
+ * MSVC does not have isnan(), but it does
+ * have _isnan() which does the same as isnan()
+ */
+#ifndef __MSVC_ISNAN_FALLBACK__
+#define __MSVC_ISNAN_FALLBACK__
+static inline gboolean
+isnan (double x)
+{
+ return _isnan (x);
+}
+#endif /* __MSVC_ISNAN_FALLBACK__ */
+#endif /* _MSC_VER < 1800 */
diff --git a/build/win32/vs9/rsvg-build-defines.vsprops b/build/win32/vs9/rsvg-build-defines.vsprops
index 5fff8a05..1eddc6e7 100644
--- a/build/win32/vs9/rsvg-build-defines.vsprops
+++ b/build/win32/vs9/rsvg-build-defines.vsprops
@@ -21,7 +21,7 @@
/>
<UserMacro
Name="LibRsvgIncPath"
- Value="$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\libcroco-0.6;$(GlibEtcInstallRoot)\include\libxml2"
+ Value="$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\libcroco-0.6;$(GlibEtcInstallRoot)\include\libxml2;.\"
/>
<UserMacro
Name="Gtk3IncPath"