<commit_before>#include "platform.h"
#include <stdlib.h>
#include <boost/filesystem.hpp>
#include <iostream>

#if defined(WIN32)
	#include <codecvt>
#elif defined(__linux__)
	#include <unistd.h>
	#include <sys/reboot.h>
#endif

std::string getConfigDirectory()
{
    boost::filesystem::path path;
#ifdef _WIN32
#include <windows.h>
#include <shlobj.h>
    CHAR my_documents[MAX_PATH];
    SHGetFolderPath(NULL, CSIDL_PRESONAL, NULL, SHGFP_TYPE_CURRENT, my_documents);
    path = boost::filesystem::path(my_documents) / "EmulationStation";
#elif __APPLE__ && !defined(USE_XDG_OSX)
    const char* homePath = getenv("HOME");
    path = boost::filesystem::path(homePath);
    path /= "Library" / "Application Support" / "org.emulationstation.EmulationStation" ;
#else
    const char* envXdgConfig = getenv("XDG_CONFIG_HOME");
    if(envXdgConfig){
        path = boost::filesystem::path(envXdgConfig);
    } else {
        const char* homePath = getenv("HOME");
        path = boost::filesystem::path(homePath);
        path /= boost::filesystem::path(".config");
    }
    path /= boost::filesystem::path("emulationstation");
#endif
    return path.generic_string();
}

std::string getHomePath()
{
	std::string homePath;

	// this should give you something like "/home/YOUR_USERNAME" on Linux and "C:\Users\YOUR_USERNAME\" on Windows
	const char * envHome = getenv("HOME");
	if(envHome != nullptr)
	{
		homePath = envHome;
	}

#ifdef WIN32
	// but does not seem to work for Windows XP or Vista, so try something else
	if (homePath.empty()) {
		const char * envDir = getenv("HOMEDRIVE");
		const char * envPath = getenv("HOMEPATH");
		if (envDir != nullptr && envPath != nullptr) {<commit_msg>Fixed OSX and Windows build<commit_after>#include "platform.h"
#include <stdlib.h>
#include <boost/filesystem.hpp>
#include <iostream>

#if defined(WIN32)
	#include <codecvt>
#elif defined(__linux__)
	#include <unistd.h>
	#include <sys/reboot.h>
#endif

namespace fs = boost::filesystem;

std::string getConfigDirectory()
{
    fs::path path;
#ifdef _WIN32
#include <windows.h>
#include <shlobj.h>
    CHAR my_documents[MAX_PATH];
    SHGetFolderPath(NULL, CSIDL_PRESONAL, NULL, SHGFP_TYPE_CURRENT, my_documents);
    path = fs::path(my_documents) / fs::path("EmulationStation");
#elif __APPLE__ && !defined(USE_XDG_OSX)
    const char* homePath = getenv("HOME");
    path = boost::filesystem::path(homePath);
    path /= fs::path("Library") / fs::path("Application Support") / fs::path("org.emulationstation.EmulationStation") ;
#else
    const char* envXdgConfig = getenv("XDG_CONFIG_HOME");
    if(envXdgConfig){
        path = fs::path(envXdgConfig);
    } else {
        const char* homePath = getenv("HOME");
        path = fs::path(homePath);
        path /= fs::path(".config");
    }
    path /= fs::path("emulationstation");
#endif
    return path.generic_string();
}

std::string getHomePath()
{
	std::string homePath;

	// this should give you something like "/home/YOUR_USERNAME" on Linux and "C:\Users\YOUR_USERNAME\" on Windows
	const char * envHome = getenv("HOME");
	if(envHome != nullptr)
	{
		homePath = envHome;
	}

#ifdef WIN32
	// but does not seem to work for Windows XP or Vista, so try something else
	if (homePath.empty()) {
		const char * envDir = getenv("HOMEDRIVE");
		const char * envPath = getenv("HOMEPATH");
		if (envDir != nullptr && envPath != nullptr) {
{'fraction_non_alphanumeric': 0.1479727730097662, 'fraction_numerical': 0.003551346552234389, 'mean_word_length': 4.434083601286174, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3677048', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1149, 'n_words': 271}