<commit_before>#pragma once

#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <tuple>
#include <queue>
#include <functional>
#include <chrono>
#include <thread>
#include <mutex>

#include <SDL/SDL.h>

/* SDL defines main to be SDL_main which is annoying */
#ifdef main
#undef main
#endif

const char pathSeparator =
#ifdef _WIN32
'\\'
#else
'/'
#endif
;

inline const char *basename(const char *path) {
	const char *r = strrchr(path, pathSeparator);
	return r ? r + 1 : path;
}

#define BASEFILE (basename(__FILE__))

#define OUTPUT(S) (std::cout << S)
#define ERROR(S)  (std::cerr << "========== ERROR ==========\n" << S << '\n')

#ifdef _DEBUG
#define DEBUG(S) OUTPUT(S)
#define CONTINUE ((std::cout << "Press enter to continue."), (std::cin.ignore(1)))
#else
#define DEBUG(S)
#define CONTINUE
#endif

inline int _SDL_real(const char *file, const long line, const char *code) {
	const char *err = SDL_GetError();
	if(strlen(err) > 0) {
		ERROR("SDL: " << err);
		DEBUG("    " << file << ':' << line << '\n');
		DEBUG("    " << code << "\n\n");
	}
	return strlen(err) == 0;
}

#define SDL(CODE) ((CODE), _SDL_real(BASEFILE, __LINE__, #CODE))
<commit_msg>Improved _SDL_real.<commit_after>#pragma once

#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <tuple>
#include <queue>
#include <functional>
#include <chrono>
#include <thread>
#include <mutex>

#include <SDL/SDL.h>

/* SDL defines main to be SDL_main which is annoying */
#ifdef main
#undef main
#endif

const char pathSeparator =
#ifdef _WIN32
'\\'
#else
'/'
#endif
;

inline const char *basename(const char *path) {
	const char *r = strrchr(path, pathSeparator);
	return r ? r + 1 : path;
}

#define BASEFILE (basename(__FILE__))

#define OUTPUT(S) (std::cout << S)
#define ERROR(S)  (std::cerr << "========== ERROR ==========\n" << S << '\n')

#ifdef _DEBUG
#define DEBUG(S) OUTPUT(S)
#define CONTINUE ((std::cout << "Press enter to continue."), (std::cin.ignore(1)))
#else
#define DEBUG(S)
#define CONTINUE
#endif

inline bool _SDL_real(const char *file, const long line, const char *code) {
	const char *err = SDL_GetError();
	if(err[0] == '\0') {
		ERROR("SDL: " << err);
		DEBUG("    " << file << ':' << line << '\n');
		DEBUG("    " << code << "\n\n");
	}
	return err[0] == '\0';
}

#define SDL(CODE) ((CODE), _SDL_real(BASEFILE, __LINE__, #CODE))

{'fraction_non_alphanumeric': 0.20218120805369127, 'fraction_numerical': 0.00587248322147651, 'mean_word_length': 4.665083135391924, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 26, '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': '5478832', 'n_tokens_mistral': 920, 'n_tokens_neox': 884, 'n_words': 259}