Changeset 1159


Ignore:
Timestamp:
Apr 6, 2007 10:29:20 AM (17 years ago)
Author:
bennylp
Message:

Fixed ticket #216: Build error when PJ_HAS_TCP is set to zero (thanks ChenHuan?)

Location:
pjproject/trunk
Files:
10 edited

Legend:

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

    r974 r1159  
    156156    return !pj_list_empty(&key->accept_list); 
    157157#else 
     158    PJ_UNUSED_ARG(key); 
    158159    return 0; 
    159160#endif 
  • pjproject/trunk/pjlib/src/pj/ioqueue_select.c

    r974 r1159  
    557557    else if (event_type == WRITEABLE_EVENT) 
    558558        PJ_FD_CLR((pj_sock_t)key->fd, &ioqueue->wfdset); 
     559#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0 
    559560    else if (event_type == EXCEPTION_EVENT) 
    560561        PJ_FD_CLR((pj_sock_t)key->fd, &ioqueue->xfdset); 
     562#endif 
    561563    else 
    562564        pj_assert(0); 
     
    581583    else if (event_type == WRITEABLE_EVENT) 
    582584        PJ_FD_SET((pj_sock_t)key->fd, &ioqueue->wfdset); 
     585#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0 
    583586    else if (event_type == EXCEPTION_EVENT) 
    584587        PJ_FD_SET((pj_sock_t)key->fd, &ioqueue->xfdset); 
     588#endif 
    585589    else 
    586590        pj_assert(0); 
     
    650654     */ 
    651655    if (PJ_FD_COUNT(&ioqueue->rfdset)==0 && 
    652         PJ_FD_COUNT(&ioqueue->wfdset)==0 && 
    653         PJ_FD_COUNT(&ioqueue->xfdset)==0) 
     656        PJ_FD_COUNT(&ioqueue->wfdset)==0  
     657#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0 
     658        && PJ_FD_COUNT(&ioqueue->xfdset)==0 
     659#endif 
     660        ) 
    654661    { 
    655662#if PJ_IOQUEUE_HAS_SAFE_UNREG 
  • pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c

    r974 r1159  
    367367PJ_DEF(pj_status_t) pj_ioqueue_destroy( pj_ioqueue_t *ioqueue ) 
    368368{ 
     369#if PJ_HAS_TCP 
    369370    unsigned i; 
     371#endif 
    370372    pj_ioqueue_key_t *key; 
    371373 
     
    740742{ 
    741743    DWORD dwMsec; 
     744#if PJ_HAS_TCP 
    742745    int connect_count = 0; 
     746#endif 
    743747    int event_count = 0; 
    744748 
  • pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c

    r974 r1159  
    772772            addrname.port = app.local_port; 
    773773 
    774         if (app.use_tcp) { 
     774        if (0) { 
     775#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0 
     776        } else if (app.use_tcp) { 
    775777            pj_sockaddr_in local_addr; 
    776778            pjsip_tpfactory *tpfactory; 
     
    784786                app.local_port = tpfactory->addr_name.port; 
    785787            } 
     788#endif 
    786789        } else { 
    787790            pjsip_transport *tp; 
  • pjproject/trunk/pjsip-apps/src/samples/sipstateless.c

    r974 r1159  
    3737 
    3838/* If this macro is set, TCP transport will be initialized at port 5060 */ 
    39 #define HAS_TCP_TRANSPORT 
     39#define HAS_TCP_TRANSPORT   (1 && PJ_HAS_TCP) 
    4040 
    4141/* Log identification */ 
     
    142142#endif 
    143143 
    144 #ifdef HAS_TCP_TRANSPORT 
     144#if HAS_TCP_TRANSPORT 
    145145    /*  
    146146     * Add UDP transport, with hard-coded port  
  • pjproject/trunk/pjsip/include/pjsip/sip_transport_tcp.h

    r974 r1159  
    2626 
    2727#include <pjsip/sip_transport.h> 
     28 
     29 
     30/* Only declare the API if PJ_HAS_TCP is true */ 
     31#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0 
     32 
    2833 
    2934PJ_BEGIN_DECL 
     
    113118 */ 
    114119 
     120#endif  /* PJ_HAS_TCP */ 
     121 
    115122#endif  /* __PJSIP_TRANSPORT_TCP_H__ */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c

    r1080 r1159  
    3030#include <pj/string.h> 
    3131 
     32/* Only declare the API if PJ_HAS_TCP is true */ 
     33#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0 
     34 
    3235 
    3336#define THIS_FILE       "sip_transport_tcp.c" 
     
    13661369} 
    13671370 
     1371#endif  /* PJ_HAS_TCP */ 
     1372 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r1136 r1159  
    11921192        pjsua_var.tpdata[id].data.tp = tp; 
    11931193 
     1194#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0 
     1195 
    11941196    } else if (type == PJSIP_TRANSPORT_TCP) { 
    11951197        /* 
     
    12421244        pjsua_var.tpdata[id].local_name = tcp->addr_name; 
    12431245        pjsua_var.tpdata[id].data.factory = tcp; 
     1246 
     1247#endif  /* PJ_HAS_TCP */ 
    12441248 
    12451249#if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0 
  • pjproject/trunk/pjsip/src/test-pjsip/test.c

    r974 r1159  
    227227    unsigned i; 
    228228    pjsip_transport *tp; 
     229#if PJ_HAS_TCP 
    229230    pjsip_tpfactory *tpfactory; 
    230 #endif 
     231#endif  /* PJ_HAS_TCP */ 
     232#endif  /* INCLUDE_TSX_TEST */ 
    231233    int line; 
    232234 
     
    332334    } 
    333335 
     336#if PJ_HAS_TCP 
    334337    status = pjsip_tcp_transport_start(endpt, NULL, 1, &tpfactory); 
    335338    if (status == PJ_SUCCESS) { 
     
    343346        goto on_return; 
    344347    } 
     348#endif 
    345349 
    346350 
  • pjproject/trunk/pjsip/src/test-pjsip/transport_tcp_test.c

    r974 r1159  
    2828 * TCP transport test. 
    2929 */ 
     30#if PJ_HAS_TCP 
    3031int transport_tcp_test(void) 
    3132{ 
     
    142143    return 0; 
    143144} 
     145#else   /* PJ_HAS_TCP */ 
     146int transport_tcp_test(void) 
     147{ 
     148    return 0; 
     149} 
     150#endif  /* PJ_HAS_TCP */ 
Note: See TracChangeset for help on using the changeset viewer.