[BACK]Return to patch-af CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / multimedia / handbrake / patches

File: [cvs.NetBSD.org] / pkgsrc / multimedia / handbrake / patches / Attic / patch-af (download)

Revision 1.2, Tue Apr 28 11:57:55 2009 UTC (10 years, 11 months ago) by hasso
Branch: MAIN
CVS Tags: pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, pkgsrc-2014Q4-base, pkgsrc-2014Q4, pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-2011Q4-base, pkgsrc-2011Q4, pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1, pkgsrc-2009Q4-base, pkgsrc-2009Q4, pkgsrc-2009Q3-base, pkgsrc-2009Q3, pkgsrc-2009Q2-base, pkgsrc-2009Q2
Changes since 1.1: +4 -4 lines

Make it build on DragonFly.

$NetBSD: patch-af,v 1.2 2009/04/28 11:57:55 hasso Exp $

--- libhb/ports.c.orig	2008-10-09 20:41:15.000000000 -0400
+++ libhb/ports.c	2009-01-21 08:57:58.000000000 -0500
@@ -16,6 +16,11 @@
 #include <sys/processor.h>
 #endif
 
+#if defined( SYS_NETBSD ) || defined( SYS_DRAGONFLY )
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#endif
+
 #if USE_PTHREAD
 #include <pthread.h>
 #endif
@@ -76,7 +81,7 @@ void hb_snooze( int delay )
     }
 #if defined( SYS_BEOS )
     snooze( 1000 * delay );
-#elif defined( SYS_DARWIN ) || defined( SYS_LINUX ) || defined( SYS_FREEBSD) || defined( SYS_SunOS )
+#elif defined( SYS_DARWIN ) || defined( SYS_LINUX ) || defined( SYS_FREEBSD) || defined( SYS_SunOS ) || defined( SYS_NETBSD ) || defined( SYS_DRAGONFLY )
     usleep( 1000 * delay );
 #elif defined( SYS_CYGWIN )
     Sleep( delay );
@@ -124,6 +129,12 @@ int hb_get_cpu_count()
         fclose( info );
     }
 
+#elif defined( SYS_NETBSD ) || defined( SYS_DRAGONFLY )
+    size_t oldlen = sizeof( cpu_count );
+
+    if ( sysctlbyname( "hw.ncpu", &cpu_count, &oldlen, NULL, 0 ) != 0 )
+	cpu_count = 1;
+
 #elif defined( SYS_LINUX )
     {
         FILE * info;