Ignore:
Timestamp:
Oct 15, 2009 3:48:20 AM (15 years ago)
Author:
bennylp
Message:

Ticket #972: setsockopt compatibility problems on Windows (thanks Yann and John Ridges for the reports)

  • set PJ_SOL_IP, PJ_SOL_TCP, and PJ_SOL_UDP to IPPROTO_IP, IPPROTO_TCP, and IPPROTO_UDP respectively on Windows
  • also added PJ_TCP_NODELAY and PJ_SO_REUSEADDR
File:
1 edited

Legend:

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

    r2394 r2946  
    6161#ifdef SOL_IP 
    6262const pj_uint16_t PJ_SOL_IP     = SOL_IP; 
     63#elif defined(PJ_WIN32) && PJ_WIN32 
     64const pj_uint16_t PJ_SOL_IP     = IPPROTO_IP; 
    6365#else 
    6466const pj_uint16_t PJ_SOL_IP     = 0xFFFF; 
    6567#endif /* SOL_IP */ 
     68 
    6669#if defined(SOL_TCP) 
    6770const pj_uint16_t PJ_SOL_TCP    = SOL_TCP; 
    6871#elif defined(IPPROTO_TCP) 
    6972const pj_uint16_t PJ_SOL_TCP    = IPPROTO_TCP; 
     73#elif defined(PJ_WIN32) && PJ_WIN32 
     74const pj_uint16_t PJ_SOL_TCP    = IPPROTO_TCP; 
    7075#else 
    7176const pj_uint16_t PJ_SOL_TCP    = 0xFFFF; 
    7277#endif /* SOL_TCP */ 
     78 
    7379#ifdef SOL_UDP 
    7480const pj_uint16_t PJ_SOL_UDP    = SOL_UDP; 
     81#elif defined(PJ_WIN32) && PJ_WIN32 
     82const pj_uint16_t PJ_SOL_UDP    = IPPROTO_UDP; 
    7583#else 
    7684const pj_uint16_t PJ_SOL_UDP    = 0xFFFF; 
    77 #endif 
     85#endif /* SOL_UDP */ 
     86 
    7887#ifdef SOL_IPV6 
    7988const pj_uint16_t PJ_SOL_IPV6   = SOL_IPV6; 
     89#elif defined(PJ_WIN32) && PJ_WIN32 
     90const pj_uint16_t PJ_SOL_IPV6   = IPPROTO_IPV6; 
    8091#else 
    8192const pj_uint16_t PJ_SOL_IPV6   = 0xFFFF; 
    82 #endif 
     93#endif /* SOL_IPV6 */ 
    8394 
    8495/* IP_TOS */ 
     
    117128const pj_uint16_t PJ_SO_RCVBUF  = SO_RCVBUF; 
    118129const pj_uint16_t PJ_SO_SNDBUF  = SO_SNDBUF; 
     130const pj_uint16_t PJ_TCP_NODELAY= TCP_NODELAY; 
     131const pj_uint16_t PJ_SO_REUSEADDR= SO_REUSEADDR; 
     132 
    119133/* Multicasting is not supported e.g. in PocketPC 2003 SDK */ 
    120134#ifdef IP_MULTICAST_IF 
Note: See TracChangeset for help on using the changeset viewer.