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
This commit is contained in:
Rob Kendrick 2007-06-15 22:07:11 +00:00
parent ed61b382bc
commit 43257a160b
8 changed files with 17 additions and 7 deletions

View File

@ -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>, "

View File

@ -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),

View File

@ -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);

View File

@ -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);

View File

@ -13,6 +13,7 @@
#include <assert.h>
#include <errno.h>
#include <stddef.h>
#define LIBICONV_PLUG
#include <iconv.h>
#include "content/content.h"
#include "css/css.h"

View File

@ -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;
}

View File

@ -14,7 +14,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#define LIBICONV_PLUG
#include <iconv.h>
#include "utils/log.h"

View File

@ -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.