Ignore:
Timestamp:
May 11, 2007 3:14:34 PM (17 years ago)
Author:
bennylp
Message:

HUGE changeset to make the rest of the libraries compile with C++ mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/os_core_unix.c

    r1076 r1266  
    2222 *   the RTEMS port. 
    2323 */ 
    24 #define _GNU_SOURCE 
     24#ifndef _GNU_SOURCE 
     25#   define _GNU_SOURCE 
     26#endif 
    2527#include <pj/os.h> 
    2628#include <pj/assert.h> 
     
    340342static void *thread_main(void *param) 
    341343{ 
    342     pj_thread_t *rec = param; 
     344    pj_thread_t *rec = (pj_thread_t*)param; 
    343345    void *result; 
    344346    pj_status_t rc; 
     
    507509{ 
    508510#if PJ_HAS_THREADS 
    509     pj_thread_t *rec = pj_thread_local_get(thread_tls_id); 
     511    pj_thread_t *rec = (pj_thread_t*)pj_thread_local_get(thread_tls_id); 
    510512     
    511513    if (rec == NULL) { 
     
    664666{ 
    665667    pj_status_t rc; 
    666     pj_atomic_t *atomic_var = pj_pool_calloc(pool, 1, sizeof(pj_atomic_t)); 
     668    pj_atomic_t *atomic_var; 
     669 
     670    atomic_var = PJ_POOL_ZALLOC_T(pool, pj_atomic_t); 
     671 
    667672    PJ_ASSERT_RETURN(atomic_var, PJ_ENOMEM); 
    668673     
     
    908913 
    909914/////////////////////////////////////////////////////////////////////////////// 
     915#if defined(PJ_LINUX) && PJ_LINUX!=0 
     916PJ_BEGIN_DECL 
     917PJ_DECL(int) pthread_mutexattr_settype(pthread_mutexattr_t*,int); 
     918PJ_END_DECL 
     919#endif 
     920 
    910921static pj_status_t init_mutex(pj_mutex_t *mutex, const char *name, int type) 
    911922{ 
     
    922933    if (type == PJ_MUTEX_SIMPLE) { 
    923934#if defined(PJ_LINUX) && PJ_LINUX!=0 
    924         extern int pthread_mutexattr_settype(pthread_mutexattr_t*,int); 
    925935        rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP); 
    926936#elif defined(PJ_RTEMS) && PJ_RTEMS!=0 
     
    931941    } else { 
    932942#if defined(PJ_LINUX) && PJ_LINUX!=0 
    933         extern int pthread_mutexattr_settype(pthread_mutexattr_t*,int); 
    934943        rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); 
    935944#elif defined(PJ_RTEMS) && PJ_RTEMS!=0 
     
    9921001    PJ_ASSERT_RETURN(pool && ptr_mutex, PJ_EINVAL); 
    9931002 
    994     mutex = pj_pool_alloc(pool, sizeof(*mutex)); 
     1003    mutex = PJ_POOL_ALLOC_T(pool, pj_mutex_t); 
    9951004    PJ_ASSERT_RETURN(mutex, PJ_ENOMEM); 
    9961005 
     
    12291238    PJ_UNUSED_ARG(name); 
    12301239     
    1231     rwm = pj_pool_alloc(pool, sizeof(pj_rwmutex_t)); 
     1240    rwm = PJ_POOL_ALLOC_T(pool, pj_rwmutex_t); 
    12321241    PJ_ASSERT_RETURN(rwm, PJ_ENOMEM); 
    12331242 
     
    13301339    PJ_ASSERT_RETURN(pool != NULL && ptr_sem != NULL, PJ_EINVAL); 
    13311340 
    1332     sem = pj_pool_alloc(pool, sizeof(*sem)); 
     1341    sem = PJ_POOL_ALLOC_T(pool, pj_sem_t); 
    13331342    PJ_ASSERT_RETURN(sem, PJ_ENOMEM); 
    13341343 
Note: See TracChangeset for help on using the changeset viewer.