<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/utsname.h>

#include "platform.h"

static int init = 0;
static const enum platform platform_t = UCC_PLATFORM;
static enum platform_sys platform_s; /* TODO: sys is decided at compile time */

#define INIT() \
	do{ \
		if(!init){ \
			platform_init(); \
			init = 1; \
		} \
	}while(0)

static void platform_init()
{
	struct utsname u;

	if(uname(&u) == -1){
		perror("uname()");
		exit(1);
	}

	if(!strcmp(u.sysname, "Linux")){
		platform_s = PLATFORM_LINUX;
	}else if(!strcmp(u.sysname, "FreeBSD")){
		platform_s = PLATFORM_FREEBSD;
	}else if(!strcmp(u.sysname, "Darwin")){
		platform_s = PLATFORM_DARWIN;
	}else if(!strncmp(u.sysname, "CYGWIN_NT-", 10)){
		platform_s = PLATFORM_CYGWIN;
	}else{
		fprintf(stderr, "unrecognised machine system: \"%s\"\n", u.sysname);
		exit(1);
	}
}

unsigned platform_word_size()
{
	INIT();
	switch(platform_t){
		case PLATFORM_mipsel_32:
		 return 4;
		case PLATFORM_x86_64:
		 return 8;
	}
	abort();
}

int platform_32bit(void)
{
	return 1; //platform_word_size() == 4;
}

enum platform platform_type()
{
	INIT();
	return platform_t;
}

enum platform_sys platform_sys()
{
	INIT();
	return platform_s;
}<commit_msg>The world is not 32-bit<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/utsname.h>

#include "platform.h"

static int init = 0;
static const enum platform platform_t = UCC_PLATFORM;
static enum platform_sys platform_s; /* TODO: sys is decided at compile time */

#define INIT() \
	do{ \
		if(!init){ \
			platform_init(); \
			init = 1; \
		} \
	}while(0)

static void platform_init()
{
	struct utsname u;

	if(uname(&u) == -1){
		perror("uname()");
		exit(1);
	}

	if(!strcmp(u.sysname, "Linux")){
		platform_s = PLATFORM_LINUX;
	}else if(!strcmp(u.sysname, "FreeBSD")){
		platform_s = PLATFORM_FREEBSD;
	}else if(!strcmp(u.sysname, "Darwin")){
		platform_s = PLATFORM_DARWIN;
	}else if(!strncmp(u.sysname, "CYGWIN_NT-", 10)){
		platform_s = PLATFORM_CYGWIN;
	}else{
		fprintf(stderr, "unrecognised machine system: \"%s\"\n", u.sysname);
		exit(1);
	}
}

unsigned platform_word_size()
{
	INIT();
	switch(platform_t){
		case PLATFORM_mipsel_32:
		 return 4;
		case PLATFORM_x86_64:
		 return 8;
	}
	abort();
}

int platform_32bit(void)
{
	return platform_word_size() == 4;
}

enum platform platform_type()
{
	INIT();
	return platform_t;
}

enum platform_sys platform_sys()
{
	INIT();
	return platform_s;
}
{'fraction_non_alphanumeric': 0.16203143893591293, 'fraction_numerical': 0.01652559451833938, 'mean_word_length': 4.360691144708423, 'pattern_counts': {'":': 0, '<': 11, '<?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': '4583846', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1016, 'n_words': 219}