]> git.sesse.net Git - vlc/commitdiff
* ./plugins/win32/intfwin.bpr: we now build intfwin.so at the right place.
authorSam Hocevar <sam@videolan.org>
Fri, 5 Apr 2002 03:27:27 +0000 (03:27 +0000)
committerSam Hocevar <sam@videolan.org>
Fri, 5 Apr 2002 03:27:27 +0000 (03:27 +0000)
  * ./plugins/win32/Makefile: intfwin.so can be built using commandline.
  * ./configure.in, ./include/threads.h, ./include/common.h: a custom defs.h
    file isn't needed for the intfwin plugin anymore.
  * ./INSTALL.win32: updated compilation instructions for the intfwin plugin.

ChangeLog
INSTALL.win32
Makefile
Makefile.modules
configure
configure.in
include/common.h
include/threads.h
plugins/win32/Makefile
plugins/win32/intfwin.bpr

index 10982af3f10fa533281aa58d2326373747950da7..aa1cb4a8f064de5e38bc9cb1e695e00648373f8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,11 @@
 
 HEAD
 
+  * ./plugins/win32/intfwin.bpr: we now build intfwin.so at the right place.
+  * ./plugins/win32/Makefile: intfwin.so can be built using commandline.
+  * ./configure.in, ./include/threads.h, ./include/common.h: a custom defs.h
+    file isn't needed for the intfwin plugin anymore.
+  * ./INSTALL.win32: updated compilation instructions for the intfwin plugin.
   * ./AUTHORS: added ipkiss.
   * ./plugins/win32/mainframe.cpp: disabled the "hide interface" menu
     item, not yet implemented.
index f9be1d31cdbf98634f503ee254c5d43479684426..63bd5db584f3547e46baccc0fa40bf71295b8f88 100644 (file)
@@ -128,24 +128,16 @@ Building Win32 interface with bcc32 (Borland's compiler)
 1) Compile vlc as usual.
 include\defs.h should be generated.
 
-2) Edit include\defs.h, and add the following lines if necessary:
-#define WIN32
-#define MODULE_NAME win32
-#define MODULE_NAME_IS win32
-#define PLUGIN
-#define HAVE_DYNAMIC_PLUGINS
-
-3) Still in defs.h, comment the following line to avoid compilation warnings:
-#define PACKAGE "vlc"
-
-4) From the plugin\win32 directory, use Borland C++ command-line tools
+2) From the plugin\win32 directory, use Borland C++ command-line tools
 as follows:
-bpr2mak intfwin.bpr    // Create a makefile from intfwin.bpr
+bpr2mak intfwin.bpr -s \
+  | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -DPLUGIN -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' \
+  > intfwin.mak                // Create a makefile from intfwin.bpr
 make -fintfwin                 // It's Borland's make utility !
 
-5) This should create a intfwin.so
+3) This should create a intfwin.so
 You can remove any other generated file.
 
 
 Well done, now you're ready to use vlc!
-=======================================
\ No newline at end of file
+=======================================
index 83082ca9a2fb903ee0bfcc52f785a276c73daed3..2ba5483685099f7d815d88ee4fbca18e1954638b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -142,7 +142,7 @@ PLUGINS_TARGETS := a52/a52 \
                text/rc \
                vcd/vcd \
                win32/waveout \
-               win32/win32 \
+               win32/intfwin \
                x11/x11 \
                x11/xvideo
 
index 43031c0b66f656669336a233e2bb70f46c6358c1..8956888293e4eec878b892948a0d113ff8f9ea2b 100644 (file)
@@ -73,9 +73,15 @@ $(SRC_CPP:%.cpp=%.$(suff).$(module_name)): %.$(suff).$(module_name): .dep/%.dpp
 $(SRC_CPP:%.cpp=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.cpp
        $(CC) $(CFLAGS) $(CFLAGS_EXTRA) -c $< -o $@
 
+# foo_CUSTOM lets us override all target rules for foo.so and foo.a
+ifeq (,$($(module_name)_CUSTOM))
 ../$(module_name).so: $(EXTRA_DEP) $(OBJ_ALL)
-       $(CC) $(OBJ_ALL) $(PLDFLAGS) $(LIB_$(MODULE_NAME)) $(LIB_COMMON) -o $@ && chmod a-x $@
+       $(CC) $(OBJ_ALL) $(PLDFLAGS) $(LIB_$(MODULE_NAME)) $(LIB_COMMON) -o $@
+       chmod a-x $@
 
 ../$(module_name).a: $(EXTRA_DEP) $(OBJ_ALL)
-       rm -f $@ && ar rc $@ $(OBJ_ALL) && $(RANLIB) $@
+       rm -f $@
+       ar rc $@ $(OBJ_ALL)
+       $(RANLIB) $@
+endif
 
index 6535dc703e82d1c6966b9bf7f2cfa8691ec9f691..52bf3a872932a9fded45e43ccd0a5e8407f22bee 100755 (executable)
--- a/configure
+++ b/configure
@@ -1227,11 +1227,11 @@ fi
 ALL_LINGUAS="de fr ja no ru nl"
 
 cat >> confdefs.h <<EOF
-#define PACKAGE "vlc"
+#define VLC_PACKAGE "vlc"
 EOF
 
 cat >> confdefs.h <<EOF
-#define VERSION "$VERSION"
+#define VLC_VERSION "$VERSION"
 EOF
 
 # Extract the first word of "ranlib", so it can be a program name with args.
@@ -8222,8 +8222,8 @@ s%@TUNING@%$TUNING%g
 s%@RELEASE@%$RELEASE%g
 s%@MOC@%$MOC%g
 s%@DLL_PATH@%$DLL_PATH%g
-s%@PACKAGE@%$PACKAGE%g
-s%@VERSION@%$VERSION%g
+s%@VLC_PACKAGE@%$VLC_PACKAGE%g
+s%@VLC_VERSION@%$VLC_VERSION%g
 s%@PLDFLAGS@%$PLDFLAGS%g
 s%@LIB_COMMON@%$LIB_COMMON%g
 s%@LIB_VLC@%$LIB_VLC%g
index 4bd159ef818de438377d79b455e3db1b00e11bb3..d31e1c33c56b0cd070fdbb42a7fdaa41b388fd56 100644 (file)
@@ -39,8 +39,8 @@ fi
 dnl Gettext stuff
 ALL_LINGUAS="de fr ja no ru nl"
 
-AC_DEFINE_UNQUOTED(PACKAGE, "vlc", [Package name])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Package version])
+AC_DEFINE_UNQUOTED(VLC_PACKAGE, "vlc", [Package name])
+AC_DEFINE_UNQUOTED(VLC_VERSION, "$VERSION", [Package version])
 AM_GNU_GETTEXT
 
 dnl AM_PROG_LIBTOOL
@@ -1420,8 +1420,8 @@ AC_SUBST(RELEASE)
 AC_SUBST(MOC)
 AC_SUBST(WINDRES)
 AC_SUBST(DLL_PATH)
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
+AC_SUBST(VLC_PACKAGE)
+AC_SUBST(VLC_VERSION)
 
 AC_SUBST(LDFLAGS)
 AC_SUBST(PLDFLAGS)
index fea4bf75131410d39492c8b26eb30513c64a4740..ac40cafa9d8d5b537620b3d97ea7e80da4823c7c 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: common.h,v 1.92 2002/04/05 01:05:22 gbazin Exp $
+ * $Id: common.h,v 1.93 2002/04/05 03:27:27 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -476,7 +476,12 @@ typedef __int64 off_t;
 /*****************************************************************************
  * I18n stuff
  *****************************************************************************/
-#if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT )
+#ifndef PACKAGE
+#define PACKAGE VLC_PACKAGE
+#endif
+#define VERSION VLC_VERSION
+
+#if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT ) && !defined( __BORLANDC__ )
 #   include <libintl.h>
 #else
 #   define _(String) (String)
index 4adb89ce6efcae6559c564a65877bb1793f96fb8..01b385ad99b6c50ae3ca2d29eab05d55d1182ecc 100644 (file)
@@ -3,7 +3,7 @@
  * This header provides a portable threads implementation.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: threads.h,v 1.39 2002/04/02 23:43:57 gbazin Exp $
+ * $Id: threads.h,v 1.40 2002/04/05 03:27:27 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -35,6 +35,9 @@
 #elif defined( ST_INIT_IN_ST_H )                            /* State threads */
 #   include <st.h>
 
+#elif defined( WIN32 )
+#   include <process.h>
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )  /* pthreads (like Linux & BSD) */
 #   include <pthread.h>
 #   ifdef DEBUG
@@ -52,9 +55,6 @@ int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
 #   include <kernel/scheduler.h>
 #   include <byteorder.h>
 
-#elif defined( WIN32 )
-#   include <process.h>
-
 #else
 #   error no threads available on your system !
 
@@ -100,6 +100,23 @@ typedef st_thread_t *    vlc_thread_t;
 typedef st_mutex_t *     vlc_mutex_t;
 typedef st_cond_t *      vlc_cond_t;
 
+#elif defined( WIN32 )
+typedef HANDLE vlc_thread_t;
+
+typedef struct
+{
+    CRITICAL_SECTION csection;
+    HANDLE           mutex;
+} vlc_mutex_t;
+
+typedef struct
+{
+    int             i_waiting_threads;
+    HANDLE          signal;
+} vlc_cond_t;
+
+typedef unsigned (__stdcall *PTHREAD_START) (void *);
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
 typedef pthread_t        vlc_thread_t;
 typedef pthread_mutex_t  vlc_mutex_t;
@@ -144,23 +161,6 @@ typedef struct
     thread_id       thread;
 } vlc_cond_t;
 
-#elif defined( WIN32 )
-typedef HANDLE vlc_thread_t;
-
-typedef struct
-{
-    CRITICAL_SECTION csection;
-    HANDLE           mutex;
-} vlc_mutex_t;
-
-typedef struct
-{
-    int             i_waiting_threads;
-    HANDLE          signal;
-} vlc_cond_t;
-
-typedef unsigned (__stdcall *PTHREAD_START) (void *);
-
 #endif
 
 typedef void *(*vlc_thread_func_t)(void *p_data);
@@ -216,6 +216,9 @@ static __inline__ int vlc_threads_init( void )
 #elif defined( ST_INIT_IN_ST_H )
     return st_init();
 
+#elif defined( WIN32 )
+    return 0;
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     return 0;
 
@@ -225,9 +228,6 @@ static __inline__ int vlc_threads_init( void )
 #elif defined( HAVE_KERNEL_SCHEDULER_H )
     return 0;
 
-#elif defined( WIN32 )
-    return 0;
-
 #endif
 }
 
@@ -242,6 +242,9 @@ static __inline__ int vlc_threads_end( void )
 #elif defined( ST_INIT_IN_ST_H )
     return 0;
 
+#elif defined( WIN32 )
+    return 0;
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     return 0;
 
@@ -251,9 +254,6 @@ static __inline__ int vlc_threads_end( void )
 #elif defined( HAVE_KERNEL_SCHEDULER_H )
     return 0;
 
-#elif defined( WIN32 )
-    return 0;
-
 #endif
 }
 
@@ -269,6 +269,24 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
     *p_mutex = st_mutex_new();
     return ( *p_mutex == NULL ) ? errno : 0;
 
+#elif defined( WIN32 )
+    /* We use mutexes on WinNT/2K/XP because we can use the SignalObjectAndWait
+     * function and have a 100% correct vlc_cond_wait() implementation.
+     * As this function is not available on Win9x, we can use the faster
+     * CriticalSections */
+    if( (GetVersion() < 0x80000000) && !p_main_sys->b_fast_pthread )
+    {
+        /* We are running on NT/2K/XP, we can use SignalObjectAndWait */
+        p_mutex->mutex = CreateMutex( 0, FALSE, 0 );
+        return ( p_mutex->mutex ? 0 : 1 );
+    }
+    else
+    {
+        InitializeCriticalSection( &p_mutex->csection );
+        p_mutex->mutex = NULL;
+        return 0;
+    }
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
 #   if defined(DEBUG) && defined(SYS_LINUX)
     /* Create error-checking mutex to detect threads problems more easily. */
@@ -310,24 +328,6 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
     p_mutex->init = 9999;
     return B_OK;
 
-#elif defined( WIN32 )
-    /* We use mutexes on WinNT/2K/XP because we can use the SignalObjectAndWait
-     * function and have a 100% correct vlc_cond_wait() implementation.
-     * As this function is not available on Win9x, we can use the faster
-     * CriticalSections */
-    if( (GetVersion() < 0x80000000) && !p_main_sys->b_fast_pthread )
-    {
-        /* We are running on NT/2K/XP, we can use SignalObjectAndWait */
-        p_mutex->mutex = CreateMutex( 0, FALSE, 0 );
-        return ( p_mutex->mutex ? 0 : 1 );
-    }
-    else
-    {
-        InitializeCriticalSection( &p_mutex->csection );
-        p_mutex->mutex = NULL;
-        return 0;
-    }
-
 #endif
 }
 
@@ -351,6 +351,17 @@ static __inline__ int _vlc_mutex_lock( char * psz_file, int i_line,
 #elif defined( ST_INIT_IN_ST_H )
     return st_mutex_lock( *p_mutex );
 
+#elif defined( WIN32 )
+    if( p_mutex->mutex )
+    {
+        WaitForSingleObject( p_mutex->mutex, INFINITE );
+    }
+    else
+    {
+        EnterCriticalSection( &p_mutex->csection );
+    }
+    return 0;
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     int i_return = pthread_mutex_lock( p_mutex );
     if( i_return )
@@ -380,17 +391,6 @@ static __inline__ int _vlc_mutex_lock( char * psz_file, int i_line,
     err = acquire_sem( p_mutex->lock );
     return err;
 
-#elif defined( WIN32 )
-    if( p_mutex->mutex )
-    {
-        WaitForSingleObject( p_mutex->mutex, INFINITE );
-    }
-    else
-    {
-        EnterCriticalSection( &p_mutex->csection );
-    }
-    return 0;
-
 #endif
 }
 
@@ -414,6 +414,17 @@ static __inline__ int _vlc_mutex_unlock( char * psz_file, int i_line,
 #elif defined( ST_INIT_IN_ST_H )
     return st_mutex_unlock( *p_mutex );
 
+#elif defined( WIN32 )
+    if( p_mutex->mutex )
+    {
+        ReleaseMutex( p_mutex->mutex );
+    }
+    else
+    {
+        LeaveCriticalSection( &p_mutex->csection );
+    }
+    return 0;
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     int i_return = pthread_mutex_unlock( p_mutex );
     if( i_return )
@@ -441,17 +452,6 @@ static __inline__ int _vlc_mutex_unlock( char * psz_file, int i_line,
     release_sem( p_mutex->lock );
     return B_OK;
 
-#elif defined( WIN32 )
-    if( p_mutex->mutex )
-    {
-        ReleaseMutex( p_mutex->mutex );
-    }
-    else
-    {
-        LeaveCriticalSection( &p_mutex->csection );
-    }
-    return 0;
-
 #endif
 }
 
@@ -475,6 +475,17 @@ static __inline__ int _vlc_mutex_destroy( char * psz_file, int i_line,
 #elif defined( ST_INIT_IN_ST_H )
     return st_mutex_destroy( *p_mutex );
 
+#elif defined( WIN32 )
+    if( p_mutex->mutex )
+    {
+        CloseHandle( p_mutex->mutex );
+    }
+    else
+    {
+        DeleteCriticalSection( &p_mutex->csection );
+    }
+    return 0;
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )    
     int i_return = pthread_mutex_destroy( p_mutex );
     if( i_return )
@@ -496,17 +507,6 @@ static __inline__ int _vlc_mutex_destroy( char * psz_file, int i_line,
     p_mutex->init = 0;
     return B_OK;
 
-#elif defined( WIN32 )
-    if( p_mutex->mutex )
-    {
-        CloseHandle( p_mutex->mutex );
-    }
-    else
-    {
-        DeleteCriticalSection( &p_mutex->csection );
-    }
-    return 0;
-
 #endif    
 }
 
@@ -522,6 +522,18 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
     *p_condvar = st_cond_new();
     return ( *p_condvar == NULL ) ? errno : 0;
 
+#elif defined( WIN32 )
+    /* initialise counter */
+    p_condvar->i_waiting_threads = 0;
+
+    /* Create an auto-reset event. */
+    p_condvar->signal = CreateEvent( NULL, /* no security */
+                                     FALSE,  /* auto-reset event */
+                                     FALSE,  /* non-signaled initially */
+                                     NULL ); /* unnamed */
+
+    return( !p_condvar->signal );
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     return pthread_cond_init( p_condvar, NULL );
 
@@ -549,18 +561,6 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
     p_condvar->init = 9999;
     return 0;
 
-#elif defined( WIN32 )
-    /* initialise counter */
-    p_condvar->i_waiting_threads = 0;
-
-    /* Create an auto-reset event. */
-    p_condvar->signal = CreateEvent( NULL, /* no security */
-                                     FALSE,  /* auto-reset event */
-                                     FALSE,  /* non-signaled initially */
-                                     NULL ); /* unnamed */
-
-    return( !p_condvar->signal );
-    
 #endif
 }
 
@@ -575,6 +575,13 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
 #elif defined( ST_INIT_IN_ST_H )
     return st_cond_signal( *p_condvar );
 
+#elif defined( WIN32 )
+    /* Release one waiting thread if one is available. */
+    /* For this trick to work properly, the vlc_cond_signal must be surrounded
+     * by a mutex. This will prevent another thread from stealing the signal */
+    PulseEvent( p_condvar->signal );
+    return 0;
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     return pthread_cond_signal( p_condvar );
 
@@ -622,13 +629,6 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
     }
     return 0;
 
-#elif defined( WIN32 )
-    /* Release one waiting thread if one is available. */
-    /* For this trick to work properly, the vlc_cond_signal must be surrounded
-     * by a mutex. This will prevent another thread from stealing the signal */
-    PulseEvent( p_condvar->signal );
-    return 0;
-
 #endif
 }
 
@@ -648,6 +648,17 @@ static __inline__ int vlc_cond_broadcast( vlc_cond_t *p_condvar )
 #elif defined( ST_INIT_IN_ST_H )
     return st_cond_broadcast( p_condvar );
 
+#elif defined( WIN32 )
+    /* Release all waiting threads. */
+    /* For this trick to work properly, the vlc_cond_signal must be surrounded
+     * by a mutex. This will prevent another thread from stealing the signal */
+    while( p_condvar->i_waiting_threads )
+    {
+        PulseEvent( p_condvar->signal );
+        Sleep( 1 ); /* deschedule the current thread */
+    }
+    return 0;
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     return pthread_cond_broadcast( p_condvar );
 
@@ -695,17 +706,6 @@ static __inline__ int vlc_cond_broadcast( vlc_cond_t *p_condvar )
     }
     return 0;
 
-#elif defined( WIN32 )
-    /* Release all waiting threads. */
-    /* For this trick to work properly, the vlc_cond_signal must be surrounded
-     * by a mutex. This will prevent another thread from stealing the signal */
-    while( p_condvar->i_waiting_threads )
-    {
-        PulseEvent( p_condvar->signal );
-        Sleep( 1 ); /* deschedule the current thread */
-    }
-    return 0;
-
 #endif
 }
 
@@ -736,6 +736,38 @@ static __inline__ int _vlc_cond_wait( char * psz_file, int i_line,
 
     return i_ret;
 
+#elif defined( WIN32 )
+    /* The ideal would be to use a function which atomically releases the
+     * mutex and initiate the waiting.
+     * Unfortunately only the SignalObjectAndWait function does this and it's
+     * only supported on WinNT/2K, furthermore it cannot take multiple
+     * events as parameters.
+     *
+     * The solution we use should however fulfill all our needs (even though
+     * it is not a correct pthreads implementation)
+     */
+    int i_result;
+
+    p_condvar->i_waiting_threads ++;
+
+    if( p_mutex->mutex )
+    {
+        p_main_sys->SignalObjectAndWait( p_mutex->mutex, p_condvar->signal,
+                                        INFINITE, FALSE );
+    }
+    else
+    {
+        /* Release the mutex */
+        vlc_mutex_unlock( p_mutex );
+        i_result = WaitForSingleObject( p_condvar->signal, INFINITE); 
+        p_condvar->i_waiting_threads --;
+    }
+
+    /* Reacquire the mutex before returning. */
+    vlc_mutex_lock( p_mutex );
+
+    return( i_result == WAIT_FAILED );
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
 
 #ifndef DEBUG
@@ -801,38 +833,6 @@ static __inline__ int _vlc_cond_wait( char * psz_file, int i_line,
     vlc_mutex_lock( p_mutex );
     return 0;
 
-#elif defined( WIN32 )
-    /* The ideal would be to use a function which atomically releases the
-     * mutex and initiate the waiting.
-     * Unfortunately only the SignalObjectAndWait function does this and it's
-     * only supported on WinNT/2K, furthermore it cannot take multiple
-     * events as parameters.
-     *
-     * The solution we use should however fulfill all our needs (even though
-     * it is not a correct pthreads implementation)
-     */
-    int i_result;
-
-    p_condvar->i_waiting_threads ++;
-
-    if( p_mutex->mutex )
-    {
-        p_main_sys->SignalObjectAndWait( p_mutex->mutex, p_condvar->signal,
-                                        INFINITE, FALSE );
-    }
-    else
-    {
-        /* Release the mutex */
-        vlc_mutex_unlock( p_mutex );
-        i_result = WaitForSingleObject( p_condvar->signal, INFINITE); 
-        p_condvar->i_waiting_threads --;
-    }
-
-    /* Reacquire the mutex before returning. */
-    vlc_mutex_lock( p_mutex );
-
-    return( i_result == WAIT_FAILED );
-
 #endif
 }
 
@@ -856,6 +856,9 @@ static __inline__ int _vlc_cond_destroy( char * psz_file, int i_line,
 #elif defined( ST_INIT_IN_ST_H )
     return st_cond_destroy( *p_condvar );
 
+#elif defined( WIN32 )
+    return( !CloseHandle( p_condvar->signal ) );
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     int i_result = pthread_cond_destroy( p_condvar );
     if( i_result )
@@ -872,9 +875,6 @@ static __inline__ int _vlc_cond_destroy( char * psz_file, int i_line,
     p_condvar->init = 0;
     return 0;
 
-#elif defined( WIN32 )
-    return( !CloseHandle( p_condvar->signal ) );
-
 #endif    
 }
 
@@ -922,6 +922,16 @@ static __inline__ int _vlc_thread_create( char * psz_file, int i_line,
     *p_thread = st_thread_create( func, p_data, 1, 0 );
     i_ret = ( p_thread == NULL );
     
+#elif defined( WIN32 )
+    unsigned threadID;
+    /* When using the MSVCRT C library you have to use the _beginthreadex
+     * function instead of CreateThread, otherwise you'll end up with memory
+     * leaks and the signal functions not working */
+    *p_thread = (HANDLE)_beginthreadex( NULL, 0, (PTHREAD_START) func, 
+                                        p_data, 0, &threadID );
+    
+    i_ret = ( *p_thread ? 0 : 1 );
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     i_ret = pthread_create( p_thread, NULL, func, p_data );
 
@@ -934,16 +944,6 @@ static __inline__ int _vlc_thread_create( char * psz_file, int i_line,
                               B_NORMAL_PRIORITY, p_data );
     i_ret = resume_thread( *p_thread );
 
-#elif defined( WIN32 )
-    unsigned threadID;
-    /* When using the MSVCRT C library you have to use the _beginthreadex
-     * function instead of CreateThread, otherwise you'll end up with memory
-     * leaks and the signal functions not working */
-    *p_thread = (HANDLE)_beginthreadex( NULL, 0, (PTHREAD_START) func, 
-                                        p_data, 0, &threadID );
-    
-    i_ret = ( *p_thread ? 0 : 1 );
-
 #endif
 
 #ifdef GPROF
@@ -983,6 +983,11 @@ static __inline__ void vlc_thread_exit( void )
     int result;
     st_thread_exit( &result );
     
+#elif defined( WIN32 )
+    /* For now we don't close the thread handles (because of race conditions).
+     * Need to be looked at. */
+    _endthreadex(0);
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     pthread_exit( 0 );
 
@@ -993,11 +998,6 @@ static __inline__ void vlc_thread_exit( void )
 #elif defined( HAVE_KERNEL_SCHEDULER_H )
     exit_thread( 0 );
 
-#elif defined( WIN32 )
-    /* For now we don't close the thread handles (because of race conditions).
-     * Need to be looked at. */
-    _endthreadex(0);
-
 #endif
 }
 
@@ -1023,6 +1023,9 @@ static __inline__ void _vlc_thread_join( char * psz_file, int i_line,
 #elif defined( ST_INIT_IN_ST_H )
     i_ret = st_thread_join( thread, NULL );
     
+#elif defined( WIN32 )
+    WaitForSingleObject( thread, INFINITE );
+
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
     i_ret = pthread_join( thread, NULL );
 
@@ -1034,9 +1037,6 @@ static __inline__ void _vlc_thread_join( char * psz_file, int i_line,
     int32 exit_value;
     wait_for_thread( thread, &exit_value );
 
-#elif defined( WIN32 )
-    WaitForSingleObject( thread, INFINITE );
-
 #endif
 
     if( i_ret )
index 869e19440bd703fe703ac1917e16cbbaa3c9af27..90baece5be0ac33e5ff75f935f82333f3d45f399 100644 (file)
@@ -1,2 +1,17 @@
-win32_SRC = win32.cpp
+#
+# Waveout module - the classic way to do things
+#
 waveout_SOURCES = waveout.c
+
+#
+# Borland C++ project
+# we override everything by setting intfwin_CUSTOM
+#
+intfwin_CUSTOM = yes
+BCBUILDER = "D:/Program Files/CBuilder5"
+
+../intfwin.so: Makefile
+       rm -f intfwin.mak
+       $(BCBUILDER)/Bin/bpr2mak intfwin.bpr -s | sed 's#^LIBPATH = .*#&;$$(RELEASELIBPATH)# ; s#^USERDEFINES = .*#& -DWIN32 -DPLUGIN -DMODULE_NAME_IS_intfwin -DMODULE_NAME=intfwin#' > intfwin.mak
+       $(BCBUILDER)/Bin/make -f intfwin.mak -b
+
index 6427681daa07806adc48f1d009fe73193add9eb2..914fe5e19ee120ed21f42482a20181738e2857ae 100644 (file)
@@ -3,7 +3,7 @@
 <PROJECT>\r
   <MACROS>\r
     <VERSION value="BCB.05.03"/>\r
-    <PROJECT value="intfwin.so"/>\r
+    <PROJECT value="..\intfwin.so"/>\r
     <OBJFILES value="win32.obj intf_win32.obj mainframe.obj network.obj playlist.obj \r
       preferences.obj about.obj disc.obj control.obj menu.obj messages.obj"/>\r
     <RESFILES value=""/>\r