Ignore:
Timestamp:
May 3, 2007 1:31:21 PM (17 years ago)
Author:
bennylp
Message:

Implemented ticket #246, #247, #261, #268, #250 for Symbian

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/sock_symbian.cpp

    r1244 r1246  
    211211PJ_DEF(pj_uint16_t) pj_ntohs(pj_uint16_t netshort) 
    212212{ 
    213     /* There's no difference in host/network byte order in Symbian */ 
     213#if PJ_IS_LITTLE_ENDIAN 
     214    return pj_swap16(netshort); 
     215#else 
    214216    return netshort; 
     217#endif 
    215218} 
    216219 
     
    220223PJ_DEF(pj_uint16_t) pj_htons(pj_uint16_t hostshort) 
    221224{ 
    222     /* There's no difference in host/network byte order in Symbian */ 
     225#if PJ_IS_LITTLE_ENDIAN 
     226    return pj_swap16(hostshort); 
     227#else 
    223228    return hostshort; 
     229#endif 
    224230} 
    225231 
     
    229235PJ_DEF(pj_uint32_t) pj_ntohl(pj_uint32_t netlong) 
    230236{ 
    231     /* There's no difference in host/network byte order in Symbian */ 
     237#if PJ_IS_LITTLE_ENDIAN 
     238    return pj_swap32(netlong); 
     239#else 
    232240    return netlong; 
     241#endif 
    233242} 
    234243 
     
    238247PJ_DEF(pj_uint32_t) pj_htonl(pj_uint32_t hostlong) 
    239248{ 
    240     /* There's no difference in host/network byte order in Symbian */ 
    241     return hostlong; 
     249#if PJ_IS_LITTLE_ENDIAN 
     250    return pj_swap32(hostlong); 
     251#else 
     252    return netlong; 
     253#endif 
    242254} 
    243255 
     
    251263    static char str8[20]; 
    252264 
    253     TInetAddr temp_addr((TUint32)inaddr.s_addr, (TUint)0); 
     265    /* (Symbian IP address is in host byte order) */ 
     266    TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0); 
    254267    temp_addr.Output(str16); 
    255268  
     
    295308    addr.Init(KAfInet); 
    296309    if (addr.Input(ip_addr) == KErrNone) { 
    297         /* Success */ 
    298         inp->s_addr = addr.Address(); 
     310        /* Success (Symbian IP address is in host byte order) */ 
     311        inp->s_addr = pj_htonl(addr.Address()); 
    299312        return 1; 
    300313    } else { 
     
    498511    PJ_CHECK_STACK(); 
    499512 
    500     pj_memset(&addr, 0, sizeof(addr)); 
     513    pj_bzero(&addr, sizeof(addr)); 
    501514    addr.sin_family = PJ_AF_INET; 
    502515    addr.sin_addr.s_addr = pj_htonl(addr32); 
Note: See TracChangeset for help on using the changeset viewer.