<commit_before>#include "assert.hh"

#include "exception.hh"
#include "debug.hh"

#if defined(__CYGWIN__)
#include <windows.h>
#endif

#include <sys/types.h>
#include <unistd.h>

namespace Kakoune
{

struct assert_failed : logic_error
{
    assert_failed(String message)
        : m_message(std::move(message)) {}

    const char* what() const override { return m_message.c_str(); }
private:
    String m_message;
};

void on_assert_failed(const char* message)
{
    String debug_info = "pid: " + to_string(getpid());
    write_debug("assert failed: '"_str + message + "' " + debug_info);

    const auto msg = message + "\n[Debug Infos]\n"_str + debug_info;
#if defined(__CYGWIN__)
    int res = MessageBox(NULL, msg.c_str(), "Kakoune: assert failed",
                         MB_OKCANCEL | MB_ICONERROR);
    switch (res)
    {<commit_msg>Fix missing include in assert.cc<commit_after>#include "assert.hh"

#include "exception.hh"
#include "debug.hh"

#if defined(__CYGWIN__)
#include <windows.h>
#endif

#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>

namespace Kakoune
{

struct assert_failed : logic_error
{
    assert_failed(String message)
        : m_message(std::move(message)) {}

    const char* what() const override { return m_message.c_str(); }
private:
    String m_message;
};

void on_assert_failed(const char* message)
{
    String debug_info = "pid: " + to_string(getpid());
    write_debug("assert failed: '"_str + message + "' " + debug_info);

    const auto msg = message + "\n[Debug Infos]\n"_str + debug_info;
#if defined(__CYGWIN__)
    int res = MessageBox(NULL, msg.c_str(), "Kakoune: assert failed",
                         MB_OKCANCEL | MB_ICONERROR);
    switch (res)
    {
{'fraction_non_alphanumeric': 0.13771063335270192, 'fraction_numerical': 0.0, 'mean_word_length': 3.770083102493075, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '3163874', 'n_tokens_mistral': 600, 'n_tokens_neox': 590, 'n_words': 138}