<commit_before>#include <Windows.h> // curse you, monolithic headers!
#include <sys/stat.h>
#include <direct.h>

#include "XSCommon/XSCommon.h"
#include "XSCommon/XSConsole.h"
#include "XSCommon/XSGlobals.h"
#include "XSSystem/XSOS.h"

namespace XS {

	namespace OS {

		void GetCurrentWorkingDirectory( char *cwd, size_t bufferLen ) {
			_getcwd( cwd, (int)bufferLen - 1 );
			cwd[FILENAME_MAX - 1] = '\0';
		}

		bool MkDir( const char *path ) {
			if ( !CreateDirectory( path, nullptr ) ) {
				if ( GetLastError() != ERROR_ALREADY_EXISTS )
					return false;
			}

			return true;
		}

		bool ResolvePath( char *outPath, const char *inPath, size_t pathLen ) {
			SDL_assert( outPath && inPath && "OS::ResolvePath called with invalid parameters" );

			if ( /*Stat( inPath ) &&*/ !_fullpath( outPath, inPath, pathLen ) ) {
				if ( Common::com_developer->GetBool() ) {
					Console::Print( "Could not resolve path: \"%s\" (%s)\n", inPath, strerror( errno ) );
				}
				outPath[0] = '\0';

				return false;
			}

			return true;
		}

		bool Stat( const char *path ) {
			struct _stat buf;

			if ( _stat( path, &buf ) ) {
				return false;
			}

			return true;
		}

	} // namespace OS

} // namespace XS
<commit_msg>Fix Windows builds<commit_after>#include <Windows.h> // curse you, monolithic headers!
#include <sys/stat.h>
#include <direct.h>

#include "XSCommon/XSCommon.h"
#include "XSCommon/XSConsole.h"
#include "XSCommon/XSGlobals.h"
#include "XSSystem/XSOS.h"

namespace XS {

	namespace OS {

		void GetCurrentWorkingDirectory( char *cwd, size_t bufferLen ) {
			_getcwd( cwd, (int)bufferLen - 1 );
			cwd[FILENAME_MAX - 1] = '\0';
		}

		bool MkDir( const char *path ) {
			if ( !CreateDirectory( path, nullptr ) ) {
				if ( GetLastError() != ERROR_ALREADY_EXISTS )
					return false;
			}

			return true;
		}

		bool ResolvePath( char *outPath, const char *inPath, size_t pathLen ) {
			SDL_assert( outPath && inPath && "OS::ResolvePath called with invalid parameters" );

			if ( /*Stat( inPath ) &&*/ !_fullpath( outPath, inPath, pathLen ) ) {
				if ( Common::com_developer->GetBool() ) {
					console.Print( "Could not resolve path: \"%s\" (%s)\n", inPath, strerror( errno ) );
				}
				outPath[0] = '\0';

				return false;
			}

			return true;
		}

		bool Stat( const char *path ) {
			struct _stat buf;

			if ( _stat( path, &buf ) ) {
				return false;
			}

			return true;
		}

	} // namespace OS

} // namespace XS

{'fraction_non_alphanumeric': 0.14840556009811937, 'fraction_numerical': 0.004088307440719542, 'mean_word_length': 3.051324503311258, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '3190322', 'n_tokens_mistral': 1051, 'n_tokens_neox': 874, 'n_words': 228}