<commit_before>#pragma once
#ifndef AMF_HPP
#define AMF_HPP

#include <algorithm>
#include <endian.h>

typedef unsigned char u8;
typedef std::vector<u8> v8;

template <typename T>
T swap_endian(T x) {
	u8& bytes = reinterpret_cast<u8&>(x);
	std::reverse(&bytes, &bytes + sizeof(T));
	return x;
}

#if __BYTE_ORDER == __LITTLE_ENDIAN
#define hton(x) swap_endian(x)
#define ntoh(x) swap_endian(x)
#elif __BYTE_ORDER == __BIG_ENDIAN
#define hton(x) (x)
#define ntoh(x) (x)
#else
#error Endianness not supported
#endif

#endif
<commit_msg>Fixed endianness detection for MSVC.<commit_after>#pragma once
#ifndef AMF_HPP
#define AMF_HPP

#include <algorithm>
#ifdef _WIN32
	#define __LITTLE_ENDIAN 1234
	#define __BIG_ENDIAN 4321
	#define __BYTE_ORDER __LITTLE_ENDIAN
#else
	#include <endian.h>
#endif

typedef unsigned char u8;
typedef std::vector<u8> v8;

template <typename T>
T swap_endian(T x) {
	u8& bytes = reinterpret_cast<u8&>(x);
	std::reverse(&bytes, &bytes + sizeof(T));
	return x;
}

#if __BYTE_ORDER == __LITTLE_ENDIAN
#define hton(x) swap_endian(x)
#define ntoh(x) swap_endian(x)
#elif __BYTE_ORDER == __BIG_ENDIAN
#define hton(x) (x)
#define ntoh(x) (x)
#else
#error Endianness not supported
#endif

#endif

{'fraction_non_alphanumeric': 0.12911184210526316, 'fraction_numerical': 0.01644736842105263, 'mean_word_length': 6.375757575757576, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5742236', 'n_tokens_mistral': 535, 'n_tokens_neox': 504, 'n_words': 129}