<commit_before>/*
 * Assert.h
 * 
 * This file is part of the "GaussianLib" project (Copyright (c) 2015 by <NAME>)
 * See "LICENSE.txt" for license information.
 */

#ifndef GS_ASSERT_H
#define GS_ASSERT_H


#include "Config.h"

#include <cassert>


#define _GS_TOSTRING_PRIMARY_(x) #x
#define _GS_TOSTRING_(x) _GS_TOSTRING_PRIMARY_(x)

#ifdef GS_ENABLE_ASSERT
#   ifdef GS_ASSERT_EXCEPTION
#       include <exception>
#       define GS_ASSERT(expr)                                  \
            if (!(expr))                                        \
            {                                                   \
                throw std::runtime_error(                       \
                    "assertion failed: (" #expr "), file "      \
                    __FILE__ ", line " _GS_TOSTRING_(__LINE__)  \
                );                                              \<commit_msg>Renamed "_GS_TOSTRING_..." macros to "GS_TOSTRING..." to be conform with the C++ naming convention.<commit_after>/*
 * Assert.h
 * 
 * This file is part of the "GaussianLib" project (Copyright (c) 2015 by <NAME>)
 * See "LICENSE.txt" for license information.
 */

#ifndef GS_ASSERT_H
#define GS_ASSERT_H


#include "Config.h"

#include <cassert>


#define GS_TOSTRING_PRIMARY(x) #x
#define GS_TOSTRING(x) GS_TOSTRING_PRIMARY(x)

#ifdef GS_ENABLE_ASSERT
#   ifdef GS_ASSERT_EXCEPTION
#       include <exception>
#       define GS_ASSERT(expr)                                  \
            if (!(expr))                                        \
            {                                                   \
                throw std::runtime_error(                       \
                    "assertion failed: (" #expr "), file "      \
                    __FILE__ ", line " GS_TOSTRING(__LINE__)  \
                );                                              \
{'fraction_non_alphanumeric': 0.09505907626208378, 'fraction_numerical': 0.004296455424274973, 'mean_word_length': 1.2445783132530122, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '199511', 'n_tokens_mistral': 526, 'n_tokens_neox': 471, 'n_words': 118}