<commit_before>// This file is distributed under the MIT license.
// See the LICENSE file for details.

#include <iostream>
#include <ostream>
#include <sstream>
#include <stdexcept>
#include <string>

#include <visionaray/detail/platform.h>

#if defined(VSNRAY_OS_DARWIN) || defined(VSNRAY_OS_LINUX)
#include <execinfo.h>
#include <signal.h>
#endif

#ifdef VSNRAY_OS_WIN32
#include <windows.h>
#endif

#include <visionaray/config.h>

#if VSNRAY_HAVE_GLEW
#include <GL/glew.h>
#endif

#include "gl_debug_callback.h"


namespace visionaray
{
namespace gl
{

//-------------------------------------------------------------------------------------------------
// Helpers
//

static std::string backtrace()
{
#if defined(VSNRAY_OS_DARWIN) || defined(VSNRAY_OS_LINUX)
    static const int max_frames = 16;

    void* buffer[max_frames] = { 0 };
    int cnt = ::backtrace(buffer, max_frames);<commit_msg>Need a GL extension library for debug callback<commit_after>// This file is distributed under the MIT license.
// See the LICENSE file for details.

#include <iostream>
#include <ostream>
#include <sstream>
#include <stdexcept>
#include <string>

#include <visionaray/detail/platform.h>

#if defined(VSNRAY_OS_DARWIN) || defined(VSNRAY_OS_LINUX)
#include <execinfo.h>
#include <signal.h>
#endif

#ifdef VSNRAY_OS_WIN32
#include <windows.h>
#endif

#include <visionaray/config.h>

#if VSNRAY_HAVE_GLEW
#include <GL/glew.h>
#else
#error "Extension library required"
#endif

#include "gl_debug_callback.h"


namespace visionaray
{
namespace gl
{

//-------------------------------------------------------------------------------------------------
// Helpers
//

static std::string backtrace()
{
#if defined(VSNRAY_OS_DARWIN) || defined(VSNRAY_OS_LINUX)
    static const int max_frames = 16;

    void* buffer[max_frames] = { 0 };
    int cnt = ::backtrace(buffer, max_frames);
{'fraction_non_alphanumeric': 0.2169962586851951, 'fraction_numerical': 0.005344735435595938, 'mean_word_length': 2.9745222929936306, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6793518', 'n_tokens_mistral': 637, 'n_tokens_neox': 622, 'n_words': 155}