<commit_before>//
// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// main.cpp: DLL entry point and management of thread-local data.

#include "libEGL/main.h"

#include "common/debug.h"
#include <cstdlib>


#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define TLS_OUT_OF_INDEXES -1
__declspec( thread ) DWORD currentTLS = TLS_OUT_OF_INDEXES;
__declspec( thread ) egl::Current glContext;
egl::Current* TlsGetValue(DWORD index) { return &glContext; };
void * LocalAlloc(UINT uFlags, size_t size) { return (void*) &glContext; };
void LocalFree(HLOCAL index) {};
DWORD TlsAlloc() { return 1; };
void TlsSetValue(DWORD currentTLS, egl::Current* current) {};
void TlsFree(DWORD index) {currentTLS = TLS_OUT_OF_INDEXES;};
#else
static DWORD currentTLS = TLS_OUT_OF_INDEXES;
#endif


extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
        {
#if !defined(ANGLE_DISABLE_TRACE)
            FILE *debug = fopen(TRACE_OUTPUT_FILE, "rt");

            if (debug)
            {
                fclose(debug);
                debug = fopen(TRACE_OUTPUT_FILE, "wt");   // Erase
                
                if (debug)
                {
                    fclose(debug);
                }
            }
#endif

            currentTLS = TlsAlloc();

            if (currentTLS == TLS_OUT_OF_INDEXES)
            {
                return FALSE;
            }
        }<commit_msg>use ANGLE_PLATFORM_WINRT<commit_after>//
// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// main.cpp: DLL entry point and management of thread-local data.

#include "libEGL/main.h"

#include "common/debug.h"
#include <cstdlib>


#if defined(ANGLE_PLATFORM_WINRT)
#define TLS_OUT_OF_INDEXES -1
__declspec( thread ) DWORD currentTLS = TLS_OUT_OF_INDEXES;
__declspec( thread ) egl::Current glContext;
egl::Current* TlsGetValue(DWORD index) { return &glContext; };
void * LocalAlloc(UINT uFlags, size_t size) { return (void*) &glContext; };
void LocalFree(HLOCAL index) {};
DWORD TlsAlloc() { return 1; };
void TlsSetValue(DWORD currentTLS, egl::Current* current) {};
void TlsFree(DWORD index) {currentTLS = TLS_OUT_OF_INDEXES;};
#else
static DWORD currentTLS = TLS_OUT_OF_INDEXES;
#endif // #if defined(ANGLE_PLATFORM_WINRT)


extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
        {
#if !defined(ANGLE_DISABLE_TRACE)
            FILE *debug = fopen(TRACE_OUTPUT_FILE, "rt");

            if (debug)
            {
                fclose(debug);
                debug = fopen(TRACE_OUTPUT_FILE, "wt");   // Erase
                
                if (debug)
                {
                    fclose(debug);
                }
            }
#endif

            currentTLS = TlsAlloc();

            if (currentTLS == TLS_OUT_OF_INDEXES)
            {
                return FALSE;
            }
        }
{'fraction_non_alphanumeric': 0.10439900867410161, 'fraction_numerical': 0.006195786864931847, 'mean_word_length': 2.453475935828877, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7178809', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1005, 'n_words': 269}