-#if defined( UNDER_CE )
-#elif defined( WIN32 )
-# include <process.h> /* Win32 API */
-
-#else /* pthreads (like Linux & BSD) */
-# define LIBVLC_USE_PTHREAD 1
-# define LIBVLC_USE_PTHREAD_CANCEL 1
-# define _APPLE_C_SOURCE 1 /* Proper pthread semantics on OSX */
-
-# include <unistd.h> /* _POSIX_SPIN_LOCKS */
-# include <pthread.h>
-
-/* Unnamed POSIX semaphores not supported on Mac OS X, use Mach semaphores instead */
-# if defined (__APPLE__)
-# include <mach/semaphore.h>
-# include <mach/task.h>
-# else
-# include <semaphore.h>
-# endif
-
-#endif
-
-/*****************************************************************************
- * Constants
- *****************************************************************************/
-
-/* Thread priorities */
-#ifdef __APPLE__
-# define VLC_THREAD_PRIORITY_LOW 0
-# define VLC_THREAD_PRIORITY_INPUT 22
-# define VLC_THREAD_PRIORITY_AUDIO 22
-# define VLC_THREAD_PRIORITY_VIDEO 0
-# define VLC_THREAD_PRIORITY_OUTPUT 22
-# define VLC_THREAD_PRIORITY_HIGHEST 22
-
-#elif defined(LIBVLC_USE_PTHREAD)
-# define VLC_THREAD_PRIORITY_LOW 0
-# define VLC_THREAD_PRIORITY_INPUT 10
-# define VLC_THREAD_PRIORITY_AUDIO 5
-# define VLC_THREAD_PRIORITY_VIDEO 0
-# define VLC_THREAD_PRIORITY_OUTPUT 15
-# define VLC_THREAD_PRIORITY_HIGHEST 20
-
-#elif defined(WIN32) || defined(UNDER_CE)
-/* Define different priorities for WinNT/2K/XP and Win9x/Me */
-# define VLC_THREAD_PRIORITY_LOW 0
-# define VLC_THREAD_PRIORITY_INPUT \
- THREAD_PRIORITY_ABOVE_NORMAL
-# define VLC_THREAD_PRIORITY_AUDIO \
- THREAD_PRIORITY_HIGHEST
-# define VLC_THREAD_PRIORITY_VIDEO 0
-# define VLC_THREAD_PRIORITY_OUTPUT \
- THREAD_PRIORITY_ABOVE_NORMAL
-# define VLC_THREAD_PRIORITY_HIGHEST \
- THREAD_PRIORITY_TIME_CRITICAL
-
-#else
-# define VLC_THREAD_PRIORITY_LOW 0
-# define VLC_THREAD_PRIORITY_INPUT 0
-# define VLC_THREAD_PRIORITY_AUDIO 0
-# define VLC_THREAD_PRIORITY_VIDEO 0
-# define VLC_THREAD_PRIORITY_OUTPUT 0
-# define VLC_THREAD_PRIORITY_HIGHEST 0
-
-#endif
-
-/*****************************************************************************
- * Type definitions
- *****************************************************************************/