Changeset 1788 for pjproject


Ignore:
Timestamp:
Feb 8, 2008 3:21:41 PM (17 years ago)
Author:
bennylp
Message:

More ticket #472: Fixed problem when building on Mingw. Now PJ_FD_SETSIZE_SETABLE is only enabled when winsock.h is present

Location:
pjproject/trunk/pjlib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/config.h

    r1783 r1788  
    488488 */ 
    489489#ifndef PJ_IOQUEUE_MAX_HANDLES 
    490 #   if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 
    491 #       define PJ_IOQUEUE_MAX_HANDLES   (64) 
    492 #   else 
    493 #       define PJ_IOQUEUE_MAX_HANDLES   (256) 
    494 #   endif 
     490#   define PJ_IOQUEUE_MAX_HANDLES       (64) 
    495491#endif 
    496492 
     
    533529/** 
    534530 * Determine if FD_SETSIZE is changeable/set-able. If so, then we will 
    535  * set it to PJ_IOQUEUE_MAX_HANDLES. 
    536  */ 
    537 /* This is awful, as we should actually check for __GLIBC__ rather than 
    538  * __GNUC__. But alas! Libc headers are not included yet at this stage. 
    539  */ 
    540 #ifdef __GNUC__ 
    541 #   define PJ_FD_SETSIZE_SETABLE        0 
    542 #else 
    543 #   define PJ_FD_SETSIZE_SETABLE        1 
     531 * set it to PJ_IOQUEUE_MAX_HANDLES. Currently we detect this by checking 
     532 * for Winsock. 
     533 */ 
     534#ifndef PJ_FD_SETSIZE_SETABLE 
     535#   if defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H!=0 
     536#       define PJ_FD_SETSIZE_SETABLE    1 
     537#   else 
     538#       define PJ_FD_SETSIZE_SETABLE    0 
     539#   endif 
    544540#endif 
    545541 
    546542/** 
    547543 * Overrides FD_SETSIZE so it is consistent throughout the library. 
    548  * We only do this if we detected that FD_SETSIZE is changeable. 
    549  * 
    550  * Default: #PJ_IOQUEUE_MAX_HANDLES 
     544 * We only do this if we detected that FD_SETSIZE is changeable. If 
     545 * FD_SETSIZE is not set-able, then PJ_IOQUEUE_MAX_HANDLES must be 
     546 * set to value lower than FD_SETSIZE. 
    551547 */ 
    552548#if PJ_FD_SETSIZE_SETABLE 
  • pjproject/trunk/pjlib/src/pj/ioqueue_select.c

    r1531 r1788  
    3838#include <pj/sock_select.h> 
    3939#include <pj/errno.h> 
     40 
     41/* Now that we have access to OS'es <sys/select>, lets check again that 
     42 * PJ_IOQUEUE_MAX_HANDLES is not greater than FD_SETSIZE 
     43 */ 
     44#if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE 
     45#   error "PJ_IOQUEUE_MAX_HANDLES cannot be greater than FD_SETSIZE" 
     46#endif 
     47 
    4048 
    4149/* 
  • pjproject/trunk/pjlib/src/pj/sock_select.c

    r1783 r1788  
    3434#   pragma warning(disable: 4018)    // Signed/unsigned mismatch in FD_* 
    3535#   pragma warning(disable: 4389)    // Signed/unsigned mismatch in FD_* 
    36 #endif 
    37  
    38 /* Now that we have access to OS'es <sys/select>, lets check again that 
    39  * PJ_IOQUEUE_MAX_HANDLES is not greater than FD_SETSIZE 
    40  */ 
    41 #if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE 
    42 #   error "PJ_IOQUEUE_MAX_HANDLES cannot be greater than FD_SETSIZE" 
    4336#endif 
    4437 
Note: See TracChangeset for help on using the changeset viewer.