summaryrefslogtreecommitdiff
path: root/examples
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 /examples
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.
Diffstat (limited to 'examples')
-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
5 files changed, 40 insertions, 10 deletions
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;