summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@gnome.org>2008-02-19 09:02:53 -0600
committerJonathon Jongsma <jjongsma@gnome.org>2008-02-19 09:02:53 -0600
commit8cf0cdfce485785c365adfe2e385c0dae9791859 (patch)
tree9ed92e133e9853fd2df6533b7903a2634e0a260a
parenta2b10d83de0d400b6a414e83f409b26604480b79 (diff)
cherry-pick solaris fix from master
* 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. Conflicts: ChangeLog
-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 baaa144..00e938d 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.
+
== 1.4.6 ==
2007-11-10 Jonathon Jongsma <jjongsma@gnome.org>
diff --git a/cairomm/context.cc b/cairomm/context.cc
index a4b60e9..d0311d2 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 46f9785..cc4d982 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.4)
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;