<commit_before>#ifdef _WIN32

#include "lldb/Host/ProcessRunLock.h"
#include "lldb/Host/windows/windows.h"

namespace lldb_private {

    // Windows has slim read-writer lock support on Vista and higher, so we
    // will attempt to load the APIs.  If they exist, we will use them, and
    // if not, we will fall back on critical sections.  When we drop support
    // for XP, we can stop lazy-loading these APIs and just use them directly.
#if defined(__MINGW32__)
    // Taken from WinNT.h
    typedef struct _RTL_SRWLOCK {
        PVOID Ptr;
    } RTL_SRWLOCK, *PRTL_SRWLOCK;

    // Taken from WinBase.h
    typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
#endif


    typedef struct Win32RWLOCK
    {
        unsigned long int readlockcount;
        HANDLE writable;
        CRITICAL_SECTION writelock;
        unsigned long int writelocked;
    } Win32RWLOCK;

    typedef Win32RWLOCK* PWin32RWLOCK;

    static VOID (WINAPI *fpInitializeSRWLock)(PSRWLOCK lock) = NULL;
    static VOID (WINAPI *fpAcquireSRWLockExclusive)(PSRWLOCK lock) = NULL;
    static VOID (WINAPI *fpAcquireSRWLockShared)(PSRWLOCK lock) = NULL;
    static VOID (WINAPI *fpReleaseSRWLockExclusive)(PSRWLOCK lock) = NULL;
    static VOID (WINAPI *fpReleaseSRWLockShared)(PSRWLOCK lock) = NULL;
    static BOOL (WINAPI *fpTryAcquireSRWLockExclusive)(PSRWLOCK lock) = NULL;
    static BOOL (WINAPI *fpTryAcquireSRWLockShared)(PSRWLOCK lock) = NULL;

    static bool sHasSRW = false;

    static bool loadSRW()
    {
        static bool sChecked = false;
        if (!sChecked)
        {
            sChecked = true;
            return false;

            HMODULE hLib = ::LoadLibrary(TEXT("Kernel32"));<commit_msg>Change type of a few members of a struct from unsigned to signed. They are used in Windows APIs which expect a signed argument and cause a build failure on Mingw.<commit_after>#ifdef _WIN32

#include "lldb/Host/ProcessRunLock.h"
#include "lldb/Host/windows/windows.h"

namespace lldb_private {

    // Windows has slim read-writer lock support on Vista and higher, so we
    // will attempt to load the APIs.  If they exist, we will use them, and
    // if not, we will fall back on critical sections.  When we drop support
    // for XP, we can stop lazy-loading these APIs and just use them directly.
#if defined(__MINGW32__)
    // Taken from WinNT.h
    typedef struct _RTL_SRWLOCK {
        PVOID Ptr;
    } RTL_SRWLOCK, *PRTL_SRWLOCK;

    // Taken from WinBase.h
    typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
#endif


    typedef struct Win32RWLOCK
    {
        long int readlockcount;
        HANDLE writable;
        CRITICAL_SECTION writelock;
        long int writelocked;
    } Win32RWLOCK;

    typedef Win32RWLOCK* PWin32RWLOCK;

    static VOID (WINAPI *fpInitializeSRWLock)(PSRWLOCK lock) = NULL;
    static VOID (WINAPI *fpAcquireSRWLockExclusive)(PSRWLOCK lock) = NULL;
    static VOID (WINAPI *fpAcquireSRWLockShared)(PSRWLOCK lock) = NULL;
    static VOID (WINAPI *fpReleaseSRWLockExclusive)(PSRWLOCK lock) = NULL;
    static VOID (WINAPI *fpReleaseSRWLockShared)(PSRWLOCK lock) = NULL;
    static BOOL (WINAPI *fpTryAcquireSRWLockExclusive)(PSRWLOCK lock) = NULL;
    static BOOL (WINAPI *fpTryAcquireSRWLockShared)(PSRWLOCK lock) = NULL;

    static bool sHasSRW = false;

    static bool loadSRW()
    {
        static bool sChecked = false;
        if (!sChecked)
        {
            sChecked = true;
            return false;

            HMODULE hLib = ::LoadLibrary(TEXT("Kernel32"));
{'fraction_non_alphanumeric': 0.07901517320354996, 'fraction_numerical': 0.008016032064128256, 'mean_word_length': 3.0580720092915215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2873927', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1120, 'n_words': 349}