From ada047feb7707b369e2aa10317f4baba666fc3fe Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 19 Feb 2008 15:35:24 +0100 Subject: 2008-02-19 Tim Mooney * 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. --- ChangeLog | 11 +++++++++++ cairomm/context.cc | 7 ++++++- configure.in | 3 +++ examples/pdf-surface/main.cc | 10 ++++++++-- examples/png_file/main.cc | 10 ++++++++-- examples/ps-surface/main.cc | 10 ++++++++-- examples/svg-surface/main.cc | 10 ++++++++-- examples/text-rotate/text-rotate.cc | 10 ++++++++-- 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 + + * 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 * 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 #include #include #include @@ -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 #endif +/* Solaris et. al. need math.h for M_PI too */ +#ifdef HAVE_MATH_H +# include +#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 #include +#include #include #include -/* 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 #endif +#ifdef HAVE_MATH_H +# include +#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 #include +#include #include #include -/* 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 #endif +#ifdef HAVE_MATH_H +# include +#endif + int main() { Cairo::RefPtr 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 #include +#include #include #include -/* 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 #endif +#ifdef HAVE_MATH_H +# include +#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 #include +#include #include #include -/* 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 #endif +#ifdef HAVE_MATH_H +# include +#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 #include +#include #include -/* 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 #endif +#ifdef HAVE_MATH_H +# include +#endif + // This example is based on the C cairo example of the same name const int WIDTH = 150; -- cgit v1.2.3