summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc-desktop.(none)>2008-02-19 15:35:24 +0100
committerMurray Cumming <murrayc@murrayc-desktop.(none)>2008-02-19 15:35:24 +0100
commitada047feb7707b369e2aa10317f4baba666fc3fe (patch)
treeab98e8f44d89b0f24a499330df64a6263a5594ab
parentc2e54447cf285684d90a88c100324ef9af8a703c (diff)
2008-02-19 Tim Mooney <enchanter@users.sourceforge.net>
* configure.in: Added check, defining HAVE_MATH_H. * cairomm/context.cc: * examples/pdf-surface/main.cc: * examples/png_file/main.cc: * examples/ps-surface/main.cc: * examples/svg-surface/main.cc: * examples/text-rotate/text-rotate.cc: Added includes of math.h to fix the build with Sun Workshop 12. Bug #14558.
-rw-r--r--ChangeLog11
-rw-r--r--cairomm/context.cc7
-rw-r--r--configure.in3
-rw-r--r--examples/pdf-surface/main.cc10
-rw-r--r--examples/png_file/main.cc10
-rw-r--r--examples/ps-surface/main.cc10
-rw-r--r--examples/svg-surface/main.cc10
-rw-r--r--examples/text-rotate/text-rotate.cc10
8 files changed, 60 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ebbd05..e8ed1a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-02-19 Tim Mooney <enchanter@users.sourceforge.net>
+
+ * configure.in: Added check, defining HAVE_MATH_H.
+ * cairomm/context.cc:
+ * examples/pdf-surface/main.cc:
+ * examples/png_file/main.cc:
+ * examples/ps-surface/main.cc:
+ * examples/svg-surface/main.cc:
+ * examples/text-rotate/text-rotate.cc: Added includes of math.h to
+ fix the build with Sun Workshop 12. Bug #14558.
+
2008-01-30 Jonathon Jongsma <jjongsma@gnome.org>
* cairomm/context.cc:
diff --git a/cairomm/context.cc b/cairomm/context.cc
index 706e1e8..8964dd5 100644
--- a/cairomm/context.cc
+++ b/cairomm/context.cc
@@ -16,6 +16,7 @@
* 02110-1301, USA.
*/
+#include <cairomm/cairommconfig.h>
#include <cairomm/context.h>
#include <cairomm/private.h>
#include <cairomm/surface.h>
@@ -26,9 +27,13 @@
/* M_PI is defined in math.h in the case of Microsoft Visual C++ */
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
-#include <math.h>
#endif
+/* Solaris et. al. need math.h for M_PI too */
+#ifdef HAVE_MATH_H
+# include <math.h>
+#endif
+
namespace Cairo
{
diff --git a/configure.in b/configure.in
index 366c66a..b9360bd 100644
--- a/configure.in
+++ b/configure.in
@@ -101,6 +101,9 @@ if test x"$os_win32" = xyes; then
fi
AC_CHECK_HEADERS(string list map, , exit)
+dnl some platforms (e.g. Solaris) need additional C headers included so
+dnl that there are always prototypes and defines available.
+AC_CHECK_HEADERS(math.h)
PKG_CHECK_MODULES(CAIROMM, cairo >= 1.5.8)
diff --git a/examples/pdf-surface/main.cc b/examples/pdf-surface/main.cc
index 7ae44b5..a4114ed 100644
--- a/examples/pdf-surface/main.cc
+++ b/examples/pdf-surface/main.cc
@@ -1,14 +1,20 @@
#include <string>
#include <iostream>
+#include <cairomm/cairommconfig.h>
#include <cairomm/context.h>
#include <cairomm/surface.h>
-/* M_PI is defined in math.h in the case of Microsoft Visual C++ */
+/* M_PI is defined in math.h in the case of Microsoft Visual C++, Solaris,
+ * et. al.
+ */
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
-#include <math.h>
#endif
+#ifdef HAVE_MATH_H
+# include <math.h>
+#endif
+
int main()
{
#ifdef CAIRO_HAS_PDF_SURFACE
diff --git a/examples/png_file/main.cc b/examples/png_file/main.cc
index d34efca..8423f2f 100644
--- a/examples/png_file/main.cc
+++ b/examples/png_file/main.cc
@@ -1,14 +1,20 @@
#include <string>
#include <iostream>
+#include <cairomm/cairommconfig.h>
#include <cairomm/context.h>
#include <cairomm/surface.h>
-/* M_PI is defined in math.h in the case of Microsoft Visual C++ */
+/* M_PI is defined in math.h in the case of Microsoft Visual C++, Solaris,
+ * et. al.
+ */
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
-#include <math.h>
#endif
+#ifdef HAVE_MATH_H
+# include <math.h>
+#endif
+
int main()
{
Cairo::RefPtr<Cairo::ImageSurface> surface =
diff --git a/examples/ps-surface/main.cc b/examples/ps-surface/main.cc
index dc02fc9..d6049d8 100644
--- a/examples/ps-surface/main.cc
+++ b/examples/ps-surface/main.cc
@@ -1,14 +1,20 @@
#include <string>
#include <iostream>
+#include <cairomm/cairommconfig.h>
#include <cairomm/context.h>
#include <cairomm/surface.h>
-/* M_PI is defined in math.h in the case of Microsoft Visual C++ */
+/* M_PI is defined in math.h in the case of Microsoft Visual C++, Solaris,
+ * et. al.
+ */
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
-#include <math.h>
#endif
+#ifdef HAVE_MATH_H
+# include <math.h>
+#endif
+
int main()
{
#ifdef CAIRO_HAS_PS_SURFACE
diff --git a/examples/svg-surface/main.cc b/examples/svg-surface/main.cc
index eb25379..5bab1dd 100644
--- a/examples/svg-surface/main.cc
+++ b/examples/svg-surface/main.cc
@@ -1,14 +1,20 @@
#include <string>
#include <iostream>
+#include <cairomm/cairommconfig.h>
#include <cairomm/context.h>
#include <cairomm/surface.h>
-/* M_PI is defined in math.h in the case of Microsoft Visual C++ */
+/* M_PI is defined in math.h in the case of Microsoft Visual C++, Solaris,
+ * et. al.
+ */
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
-#include <math.h>
#endif
+#ifdef HAVE_MATH_H
+# include <math.h>
+#endif
+
int main()
{
#ifdef CAIRO_HAS_SVG_SURFACE
diff --git a/examples/text-rotate/text-rotate.cc b/examples/text-rotate/text-rotate.cc
index 14912ef..4a78829 100644
--- a/examples/text-rotate/text-rotate.cc
+++ b/examples/text-rotate/text-rotate.cc
@@ -18,14 +18,20 @@
#include <string>
#include <iostream>
+#include <cairomm/cairommconfig.h>
#include <cairomm/cairomm.h>
-/* M_PI is defined in math.h in the case of Microsoft Visual C++ */
+/* M_PI is defined in math.h in the case of Microsoft Visual C++, and
+ * Solaris needs math.h for M_PI and floor()
+ */
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
-#include <math.h>
#endif
+#ifdef HAVE_MATH_H
+# include <math.h>
+#endif
+
// This example is based on the C cairo example of the same name
const int WIDTH = 150;