diff options
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/fifo.c | 10 | ||||
-rw-r--r-- | libhb/module.defs | 8 | ||||
-rw-r--r-- | libhb/ports.c | 4 | ||||
-rw-r--r-- | libhb/ports.h | 11 |
4 files changed, 22 insertions, 11 deletions
diff --git a/libhb/fifo.c b/libhb/fifo.c index 798179415..f2175e90c 100644 --- a/libhb/fifo.c +++ b/libhb/fifo.c @@ -13,8 +13,12 @@ #endif #ifndef SYS_DARWIN +#if defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) +#include <stdlib.h> +#else #include <malloc.h> #endif +#endif #define FIFO_TIMEOUT 200 //#define HB_FIFO_DEBUG 1 @@ -391,7 +395,7 @@ hb_buffer_t * hb_buffer_init_internal( int size ) if (size) { -#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined( SYS_MINGW ) +#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) || defined( SYS_MINGW ) b->data = malloc( b->alloc ); #elif defined( SYS_CYGWIN ) /* FIXME */ @@ -744,7 +748,7 @@ hb_image_t * hb_image_init(int pix_fmt, int width, int height) { return NULL; } -#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined( SYS_MINGW ) +#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) || defined( SYS_MINGW ) image->data = malloc(size); #elif defined( SYS_CYGWIN ) /* FIXME */ @@ -785,7 +789,7 @@ hb_image_t * hb_buffer_to_image(hb_buffer_t *buf) { hb_image_t *image = calloc(1, sizeof(hb_image_t)); -#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined( SYS_MINGW ) +#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) || defined( SYS_MINGW ) image->data = malloc( buf->size ); #elif defined( SYS_CYGWIN ) /* FIXME */ diff --git a/libhb/module.defs b/libhb/module.defs index 616fcb323..e36ec5fcb 100644 --- a/libhb/module.defs +++ b/libhb/module.defs @@ -48,10 +48,12 @@ endif LIBHB.GCC.D += __LIBHB__ USE_PTHREAD LIBHB.GCC.I += $(LIBHB.build/) $(CONTRIB.build/)include -ifneq (,$(filter $(BUILD.system),darwin cygwin mingw)) -LIBHB.GCC.I += $(CONTRIB.build/)include/libxml2 +ifeq ($(BUILD.system),freebsd) + LIBHB.GCC.I += /usr/local/include/libxml2 +else ifneq (,$(filter $(BUILD.system),darwin cygwin mingw)) + LIBHB.GCC.I += $(CONTRIB.build/)include/libxml2 else -LIBHB.GCC.I += /usr/include/libxml2 + LIBHB.GCC.I += /usr/include/libxml2 endif ifeq ($(BUILD.system),cygwin) diff --git a/libhb/ports.c b/libhb/ports.c index a483ed9bc..399ddecc8 100644 --- a/libhb/ports.c +++ b/libhb/ports.c @@ -844,7 +844,7 @@ static void attribute_align_thread hb_thread_func( void * _t ) { hb_thread_t * t = (hb_thread_t *) _t; -#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) +#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) /* Set the thread priority */ struct sched_param param; memset( ¶m, 0, sizeof( struct sched_param ) ); @@ -987,7 +987,7 @@ hb_lock_t * hb_lock_init() pthread_mutexattr_init(&mta); -#if defined( SYS_CYGWIN ) || defined( SYS_FREEBSD ) +#if defined( SYS_CYGWIN ) || defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_NORMAL); #endif diff --git a/libhb/ports.h b/libhb/ports.h index 33bb9c059..57723061b 100644 --- a/libhb/ports.h +++ b/libhb/ports.h @@ -118,9 +118,6 @@ typedef struct hb_thread_s hb_thread_t; #elif defined( SYS_DARWIN ) # define HB_LOW_PRIORITY 0 # define HB_NORMAL_PRIORITY 31 -#elif defined( SYS_LINUX ) || defined( SYS_FREEBSD ) || defined ( SYS_SunOS ) || defined ( __FreeBSD_kernel__ ) -# define HB_LOW_PRIORITY 0 -# define HB_NORMAL_PRIORITY 0 #elif defined( SYS_CYGWIN ) # define HB_LOW_PRIORITY 0 # define HB_NORMAL_PRIORITY 1 @@ -129,6 +126,14 @@ typedef struct hb_thread_s hb_thread_t; # define HB_NORMAL_PRIORITY 0 #endif +#ifndef HB_LOW_PRIORITY +#define HB_LOW_PRIORITY 0 +#endif + +#ifndef HB_NORMAL_PRIORITY +#define HB_NORMAL_PRIORITY 0 +#endif + typedef void (thread_func_t)(void *); hb_thread_t * hb_thread_init( const char * name, thread_func_t *function, void * arg, int priority ); |