Ignore:
Timestamp:
Aug 4, 2007, 1:17:39 AM (14 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 )
Note: See TracChangeset for help on using the changeset viewer.