Changeset 2614


Ignore:
Timestamp:
Aug 4, 2007, 1:17:39 AM (15 years ago)
Author:
joshe
Message:

Use BEOS to test for beos instead of relying on the build to set SYS_BEOS.
Add missing headers and other miscellaneous fixes for beos.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r2589 r2614  
    132132     ;;
    133133
    134   *BeOS*)
     134  *beos*)
    135135    beos="yes"
    136136    RELEASE=`uname -r`
  • trunk/libtransmission/http.c

    r2607 r2614  
    3131#include <sys/types.h>
    3232
    33 #ifdef SYS_BEOS
     33#ifdef __BEOS__
    3434extern int vasprintf( char **, const char *, va_list );
    3535#endif
  • trunk/libtransmission/natpmp.c

    r2591 r2614  
    2525#include <assert.h>
    2626#include <errno.h>
     27#include <netdb.h>
    2728#include <stdlib.h>
    2829#include <string.h>
  • trunk/libtransmission/net.c

    r2596 r2614  
    261261    unsigned long flags = 1;
    262262    if( ioctlsocket( s, FIONBIO, &flags) == SOCKET_ERROR )
    263 #elif defined(SYS_BEOS)
     263#elif defined(__BEOS__)
    264264    int flags = 1;
    265265    if( setsockopt( s, SOL_SOCKET, SO_NONBLOCK,
  • trunk/libtransmission/net.h

    r2611 r2614  
    3131    typedef int socklen_t;
    3232    typedef uint16_t tr_port_t;
     33#elif defined(__BEOS__)
     34    #include <sys/socket.h>
     35    #include <netinet/in.h>
     36    typedef unsigned short tr_port_t;
     37    typedef int socklen_t;
    3338#else
    3439    #include <sys/socket.h>
     
    3641    #include <arpa/inet.h>
    3742    typedef in_port_t tr_port_t;
    38 #endif
    39 
    40 #ifdef SYS_BEOS
    41     #include <inttypes.h>
    42     typedef uint32_t socklen_t;
    4343#endif
    4444
  • trunk/libtransmission/platform.c

    r2607 r2614  
    2929#include <string.h>
    3030
    31 #ifdef SYS_BEOS
     31#ifdef __BEOS__
    3232  #include <signal.h>
    3333  #include <fs_info.h>
     
    6363    char           * name;
    6464
    65 #ifdef SYS_BEOS
     65#ifdef __BEOS__
    6666    thread_id        thread;
    6767#elif defined(WIN32)
     
    8585    char* name = tr_strdup( t->name );
    8686
    87 #ifdef SYS_BEOS
     87#ifdef __BEOS__
    8888    /* This is required because on BeOS, SIGINT is sent to each thread,
    8989       which kills them not nicely */
     
    113113    t->name = tr_strdup( name );
    114114
    115 #ifdef SYS_BEOS
     115#ifdef __BEOS__
    116116    t->thread = spawn_thread( (void*)ThreadFunc, name, B_NORMAL_PRIORITY, t );
    117117    resume_thread( t->thread );
     
    130130    if( t != NULL )
    131131    {
    132 #ifdef SYS_BEOS
     132#ifdef __BEOS__
    133133        long exit;
    134134        wait_for_thread( t->thread, &exit );
     
    154154struct tr_lock_s
    155155{
    156 #ifdef SYS_BEOS
     156#ifdef __BEOS__
    157157    sem_id lock;
    158158#elif defined(WIN32)
     
    168168    tr_lock_t * l = tr_new0( tr_lock_t, 1 );
    169169
    170 #ifdef SYS_BEOS
     170#ifdef __BEOS__
    171171    l->lock = create_sem( 1, "" );
    172172#elif defined(WIN32)
     
    182182tr_lockFree( tr_lock_t * l )
    183183{
    184 #ifdef SYS_BEOS
     184#ifdef __BEOS__
    185185    delete_sem( l->lock );
    186186#elif defined(WIN32)
     
    195195tr_lockTryLock( tr_lock_t * l ) /* success on zero! */
    196196{
    197 #ifdef SYS_BEOS
     197#ifdef __BEOS__
    198198    return acquire_sem_etc( l->lock, 1, B_RELATIVE_TIMEOUT, 0 );
    199199#elif defined(WIN32)
     
    207207tr_lockLock( tr_lock_t * l )
    208208{
    209 #ifdef SYS_BEOS
     209#ifdef __BEOS__
    210210    acquire_sem( l->lock );
    211211#elif defined(WIN32)
     
    219219tr_lockUnlock( tr_lock_t * l )
    220220{
    221 #ifdef SYS_BEOS
     221#ifdef __BEOS__
    222222    release_sem( l->lock );
    223223#elif defined(WIN32)
     
    344344struct tr_cond_s
    345345{
    346 #ifdef SYS_BEOS
     346#ifdef __BEOS__
    347347    sem_id sem;
    348348    thread_id threads[BEOS_MAX_THREADS];
     
    373373{
    374374    tr_cond_t * c = tr_new0( tr_cond_t, 1 );
    375 #ifdef SYS_BEOS
     375#ifdef __BEOS__
    376376    c->sem = create_sem( 1, "" );
    377377    c->start = 0;
     
    389389tr_condWait( tr_cond_t * c, tr_lock_t * l )
    390390{
    391 #ifdef SYS_BEOS
     391#ifdef __BEOS__
    392392
    393393    /* Keep track of that thread */
     
    434434}
    435435
    436 #ifdef SYS_BEOS
     436#ifdef __BEOS__
    437437static int condTrySignal( tr_cond_t * c )
    438438{
     
    461461tr_condSignal( tr_cond_t * c )
    462462{
    463 #ifdef SYS_BEOS
     463#ifdef __BEOS__
    464464
    465465    acquire_sem( c->sem );
     
    484484tr_condBroadcast( tr_cond_t * c )
    485485{
    486 #ifdef SYS_BEOS
     486#ifdef __BEOS__
    487487
    488488    acquire_sem( c->sem );
     
    508508tr_condFree( tr_cond_t * c )
    509509{
    510 #ifdef SYS_BEOS
     510#ifdef __BEOS__
    511511    delete_sem( c->sem );
    512512#elif defined(WIN32)
     
    524524***/
    525525
    526 #if !defined(WIN32) && !defined(SYS_BEOS) && !defined(__AMIGAOS4__)
     526#if !defined(WIN32) && !defined(__BEOS__) && !defined(__AMIGAOS4__)
    527527#include <pwd.h>
    528528#endif
     
    544544#ifdef WIN32
    545545        SHGetFolderPath( NULL, CSIDL_PROFILE, NULL, 0, buf );
    546 #elif defined(SYS_BEOS) || defined(__AMIGAOS4__)
     546#elif defined(__BEOS__) || defined(__AMIGAOS4__)
    547547        *buf = '\0';
    548548#else
     
    596596
    597597    h = tr_getHomeDirectory();
    598 #ifdef SYS_BEOS
     598#ifdef __BEOS__
    599599    find_directory( B_USER_SETTINGS_DIRECTORY,
    600600                    dev_for_path("/boot"), true, buf, buflen );
     
    641641
    642642    p = tr_getPrefsDirectory();
    643 #if defined(SYS_BEOS) || defined(WIN32)
     643#if defined(__BEOS__) || defined(WIN32)
    644644    tr_buildPath( buf, buflen, p, "Cache", NULL );
    645645#elif defined( SYS_DARWIN )
     
    672672    p = tr_getPrefsDirectory ();
    673673
    674 #if defined(SYS_BEOS) || defined(WIN32)
     674#if defined(__BEOS__) || defined(WIN32)
    675675    tr_buildPath( buf, buflen, p, "Torrents", NULL );
    676676#elif defined( SYS_DARWIN )
  • trunk/libtransmission/upnp.c

    r2591 r2614  
    2626#include <errno.h>
    2727#include <limits.h>
     28#include <netdb.h>
    2829#include <stdarg.h>
    2930#include <stdio.h>
  • trunk/libtransmission/utils.c

    r2607 r2614  
    3838#ifdef WIN32
    3939    #include <windows.h> /* for Sleep */
    40 #elif defined(SYS_BEOS)
     40#elif defined(__BEOS__)
     41    #include <kernel/OS.h>
    4142    extern int vasprintf( char **, const char *, va_list );
    4243#endif
     
    721722tr_wait( uint64_t delay_milliseconds )
    722723{
    723 #ifdef SYS_BEOS
     724#ifdef __BEOS__
    724725    snooze( 1000 * delay_milliseconds );
    725726#elif defined(WIN32)
Note: See TracChangeset for help on using the changeset viewer.