$NetBSD: patch-src_common_util_c,v 1.1 2012/05/06 18:41:51 dholland Exp $ - Fix build with latest glib2 - add NetBSD support --- src/common/util.c.orig 2009-08-16 09:40:16.000000000 +0000 +++ src/common/util.c @@ -39,7 +39,6 @@ #include #include "xchat.h" #include "xchatc.h" -#include #include #include "util.h" #include "../../config.h" @@ -49,6 +48,10 @@ #if defined (USING_FREEBSD) || defined (__APPLE__) #include +#elif defined(__NetBSD__) +#define session NetBSD_session +#include +#undef session #endif #ifdef SOCKS #include @@ -510,7 +513,7 @@ strip_hidden_attribute (char *src, char return len; } -#if defined (USING_LINUX) || defined (USING_FREEBSD) || defined (__APPLE__) +#if defined (USING_LINUX) || defined (USING_FREEBSD) || defined (__APPLE__) || defined (__NetBSD__) static void get_cpu_info (double *mhz, int *cpus) @@ -554,7 +557,7 @@ get_cpu_info (double *mhz, int *cpus) *cpus = 1; #endif -#ifdef USING_FREEBSD +#if defined(USING_FREEBSD) || defined (__NetBSD__) int mib[2], ncpu; u_long freq; @@ -656,7 +659,7 @@ get_cpu_str (void) char * get_cpu_str (void) { -#if defined (USING_LINUX) || defined (USING_FREEBSD) || defined (__APPLE__) +#if defined (USING_LINUX) || defined (USING_FREEBSD) || defined (__APPLE__) || defined (__NetBSD__) double mhz; #endif int cpus = 1; @@ -670,7 +673,7 @@ get_cpu_str (void) uname (&un); -#if defined (USING_LINUX) || defined (USING_FREEBSD) || defined (__APPLE__) +#if defined (USING_LINUX) || defined (USING_FREEBSD) || defined (__APPLE__) || defined (__NetBSD__) get_cpu_info (&mhz, &cpus); if (mhz) {