3520ab8 Ticket #47728 - compilation failed with ' incomplete struct/union/enum' if not set USE_POSIX_RWLOCKS

Authored and Committed by nhosoi 9 years ago
    Ticket #47728 - compilation failed with ' incomplete struct/union/enum' if not set USE_POSIX_RWLOCKS
    
    Description:
    1) Slapi_RWLock is typedef'ed as follows without defining "struct slapi_rwlock".
    ifdef USE_POSIX_RWLOCKS
    typedef pthread_rwlock_t    Slapi_RWLock;
    else
    typedef struct slapi_rwlock Slapi_RWLock;
    endif
    According to the wrapper layer slapi2nspr.c, the "else" of USE_POSIX_RWLOCKS
    is supposed to handle PRRWLock.  This patch replaces "struct slapi_rwlock"
    with PRRWLock*.
    
    2) In slapi_entry_size and pw_get_ext_size, the size of Slapi_RWLock is
    added to the each object size.  Unfortunately, the size of PRRWLock is not
    provided by NSPR.  This patch adds an API slapi_rwlock_get_size, in which
    if not USE_POSIX_RWLOCKS, a rough estimate of the PRRWLock size is calculated
    and returned.  Note: "if USE_POSIX_RWLOCKS" is the default case and in the
    case, the size is accurate.
    
    https://fedorahosted.org/389/ticket/47728
    
    Reviewed by mreynolds@redhat.com (Thank you, Mark!!)
    
    (cherry picked from commit dbb5ef5dae65aeab87c3287d6bac946d9e71f5aa)
    
        
file modified
+1 -1
file modified
+1 -1