From 43257a160bbdef8a8381fc7cc01741568ae1e320 Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Fri, 15 Jun 2007 22:07:11 +0000 Subject: Changes to allow building on Solaris. * Tested on Solaris Express: Developer Edition, which is between Solaris 10 and 11. * Used gcc, libmng etc packages using pkg-get and blastwave's resources. * Had to build lemon and re2c manually. svn path=/trunk/netsurf/; revision=3350 --- desktop/netsurf.c | 4 +++- gtk/gtk_gui.c | 2 +- gtk/gtk_window.c | 3 ++- image/mng.c | 8 +++++++- render/textplain.c | 1 + utils/useragent.c | 2 +- utils/utf8.c | 2 +- utils/utils.c | 2 +- 8 files changed, 17 insertions(+), 7 deletions(-) diff --git a/desktop/netsurf.c b/desktop/netsurf.c index 948e29e06..802614b49 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -65,7 +65,9 @@ void netsurf_init(int argc, char** argv) { struct utsname utsname; +#if !(defined(__SVR4) && defined(__sun)) stdout = stderr; +#endif if ((argc > 1) && (argv[1][0] == '-') && (argv[1][1] == 'v') && (argv[1][2] == 0)) { int argcmv; @@ -81,7 +83,7 @@ void netsurf_init(int argc, char** argv) #endif LOG(("version '%s'", netsurf_version)); - if (uname(&utsname) != 0) + if (uname(&utsname) < 0) LOG(("Failed to extract machine information")); else LOG(("NetSurf on <%s>, node <%s>, release <%s>, version <%s>, " diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c index 13fd3c570..47a3cfd04 100644 --- a/gtk/gtk_gui.c +++ b/gtk/gtk_gui.c @@ -393,7 +393,7 @@ void warn_user(const char *warning, const char *detail) { char buf[300]; /* 300 is the size the RISC OS GUI uses */ - LOG(("%s %s", warning, detail)); + LOG(("%s %s", warning, detail ? detail : "")); fflush(stdout); snprintf(buf, sizeof(buf), "%s %s", messages_get(warning), diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c index b1ed0f731..317af10a0 100644 --- a/gtk/gtk_window.c +++ b/gtk/gtk_window.c @@ -487,7 +487,8 @@ gboolean nsgtk_window_size_allocate_event(GtkWidget *widget, { struct gui_window *g = data; - LOG(("Size allocate for %s scheduling reflow\n", g->bw->name)); + LOG(("Size allocate for %s scheduling reflow\n", g->bw->name ? + g->bw->name : "(none")); /* schedule a callback to perform the resize for 1/10s from now */ schedule(5, (gtk_callback)(nsgtk_window_reflow_content), g); diff --git a/image/mng.c b/image/mng.c index 9949e3028..2e688cdec 100644 --- a/image/mng.c +++ b/image/mng.c @@ -345,8 +345,14 @@ mng_uint32 nsmng_gettickcount(mng_handle mng) { static bool start = true; static time_t t0; struct timeval tv; +#if defined(__SVR4) && defined(__sun) + /* Solaris doesn't have this structure, and ignores the second + * parameter to gettimeofday() + */ + int tz; +#else struct timezone tz; - +#endif assert(mng != NULL); gettimeofday(&tv, &tz); diff --git a/render/textplain.c b/render/textplain.c index 5ce1b4eae..eb1588dcd 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -13,6 +13,7 @@ #include #include #include +#define LIBICONV_PLUG #include #include "content/content.h" #include "css/css.h" diff --git a/utils/useragent.c b/utils/useragent.c index 4decb7736..65ac012ad 100644 --- a/utils/useragent.c +++ b/utils/useragent.c @@ -31,7 +31,7 @@ user_agent_build_string(void) char *ua_string; int len; - if (uname(&un) == 0) { + if (uname(&un) >= 0) { sysname = un.sysname; machine = un.machine; } diff --git a/utils/utf8.c b/utils/utf8.c index 69414400e..1dcb49e93 100644 --- a/utils/utf8.c +++ b/utils/utf8.c @@ -14,7 +14,7 @@ #include #include #include - +#define LIBICONV_PLUG #include #include "utils/log.h" diff --git a/utils/utils.c b/utils/utils.c index f2250b7fa..53124a0d1 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -257,7 +257,7 @@ unsigned int wallclock(void) } -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || (defined(__SVR4) && defined(__sun)) /** * Duplicate up to n characters of a string. -- cgit v1.2.3