BeOS portability fixes from ModeenF

This commit is contained in:
Charles Kerr 2007-08-03 16:28:32 +00:00
parent 6993301e65
commit c51007f916
4 changed files with 14 additions and 10 deletions

View File

@ -30,6 +30,10 @@
#include <sys/types.h> #include <sys/types.h>
#ifdef SYS_BEOS
extern int vasprintf( char **, const char *, va_list );
#endif
#include "transmission.h" #include "transmission.h"
#include "http.h" #include "http.h"
#include "net.h" #include "net.h"

View File

@ -25,14 +25,6 @@
#ifndef TR_INTERNAL_H #ifndef TR_INTERNAL_H
#define TR_INTERNAL_H 1 #define TR_INTERNAL_H 1
#ifdef SYS_BEOS
/* BeOS doesn't declare vasprintf in its headers, but actually
* implements it */
extern int vasprintf( char **, const char *, va_list );
#include <signal.h>
#endif
#define TR_NAME "Transmission" #define TR_NAME "Transmission"
#ifdef __GNUC__ #ifdef __GNUC__

View File

@ -22,12 +22,14 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*****************************************************************************/ *****************************************************************************/
#include <assert.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef SYS_BEOS #ifdef SYS_BEOS
#include <signal.h>
#include <fs_info.h> #include <fs_info.h>
#include <FindDirectory.h> #include <FindDirectory.h>
#include <kernel/OS.h> #include <kernel/OS.h>
@ -395,9 +397,9 @@ tr_condWait( tr_cond_t * c, tr_lock_t * l )
assert( c->end != c->start ); /* We hit BEOS_MAX_THREADS, arggh */ assert( c->end != c->start ); /* We hit BEOS_MAX_THREADS, arggh */
release_sem( c->sem ); release_sem( c->sem );
release_sem( *l ); release_sem( l->lock );
suspend_thread( find_thread( NULL ) ); /* Wait for signal */ suspend_thread( find_thread( NULL ) ); /* Wait for signal */
acquire_sem( *l ); acquire_sem( l->lock );
#elif defined(WIN32) #elif defined(WIN32)

View File

@ -37,6 +37,8 @@
#ifdef WIN32 #ifdef WIN32
#include <windows.h> /* for Sleep */ #include <windows.h> /* for Sleep */
#elif defined(SYS_BEOS)
extern int vasprintf( char **, const char *, va_list );
#endif #endif
#include "transmission.h" #include "transmission.h"
@ -423,6 +425,10 @@ tr_buildPath ( char *buf, size_t buflen, const char *first_element, ... )
va_list vl; va_list vl;
char* walk = buf; char* walk = buf;
const char * element = first_element; const char * element = first_element;
if( first_element == NULL )
return;
va_start( vl, first_element ); va_start( vl, first_element );
for( ;; ) { for( ;; ) {
const size_t n = strlen( element ); const size_t n = strlen( element );