<commit_before>#include <stdlib.h>
#include <memory.h>
#include <stdio.h>
#include "SlimList.h"
#include "Fixtures.h"

class cMultiplication 
{
public:
	cMultiplication(){};
	~cMultiplication(){};
	float product()
	{
		return m1*m2;
	}
	float m1;
	float m2;
	char result[32];	
};

extern "C" {
typedef struct Multiplication
{
	cMultiplication * multiplication;
	char result[32];
} Multiplication;

void* Multiplication_Create(StatementExecutor* errorHandler, SlimList* args)
{
	Multiplication* self = (Multiplication*)malloc(sizeof(Multiplication));
	self->result[0] = 0;
	self->multiplication = new cMultiplication();
	return self;
}

void Multiplication_Destroy(void* void_self)
{
	Multiplication* self = (Multiplication*)void_self;
	delete self->multiplication;
	free(self);
}

static char* setMultiplicand1(void* void_self, SlimList* args) {
	Multiplication* self = (Multiplication*)void_self;
	self->multiplication->m1 = atof(SlimList_GetStringAt(args, 0));
	return self->result;
}

static char* setMultiplicand2(void* void_self, SlimList* args) {
	Multiplication* self = (Multiplication*)void_self;
	self->multiplication->m2 = atof(SlimList_GetStringAt(args, 0));
	return self->result;
}

static char* Product(void* void_self, SlimList* args) {
	Multiplication* self = (Multiplication*)void_self;
	float product = self->multiplication->product();
	snprintf(self->result, 32, "%g", product);
	return self->result;
}


SLIM_CREATE_FIXTURE(Multiplication) 
	SLIM_FUNCTION(setMultiplicand1)
	SLIM_FUNCTION(setMultiplicand2)
	SLIM_FUNCTION(Product)
SLIM_END

}<commit_msg>Updated to conditionally use extern "C"<commit_after>#include <stdlib.h>
#include <memory.h>
#include <stdio.h>
#include "SlimList.h"
#include "Fixtures.h"

class cMultiplication 
{
public:
	cMultiplication(){};
	~cMultiplication(){};
	float product()
	{
		return m1*m2;
	}
	float m1;
	float m2;
	char result[32];	
};

#ifndef CPP_COMPILING
extern "C" {
#endif
typedef struct Multiplication
{
	cMultiplication * multiplication;
	char result[32];
} Multiplication;

void* Multiplication_Create(StatementExecutor* errorHandler, SlimList* args)
{
	Multiplication* self = (Multiplication*)malloc(sizeof(Multiplication));
	self->result[0] = 0;
	self->multiplication = new cMultiplication();
	return self;
}

void Multiplication_Destroy(void* void_self)
{
	Multiplication* self = (Multiplication*)void_self;
	delete self->multiplication;
	free(self);
}

static char* setMultiplicand1(void* void_self, SlimList* args) {
	Multiplication* self = (Multiplication*)void_self;
	self->multiplication->m1 = atof(SlimList_GetStringAt(args, 0));
	return self->result;
}

static char* setMultiplicand2(void* void_self, SlimList* args) {
	Multiplication* self = (Multiplication*)void_self;
	self->multiplication->m2 = atof(SlimList_GetStringAt(args, 0));
	return self->result;
}

static char* Product(void* void_self, SlimList* args) {
	Multiplication* self = (Multiplication*)void_self;
	float product = self->multiplication->product();
	snprintf(self->result, 32, "%g", product);
	return self->result;
}


SLIM_CREATE_FIXTURE(Multiplication) 
	SLIM_FUNCTION(setMultiplicand1)
	SLIM_FUNCTION(setMultiplicand2)
	SLIM_FUNCTION(Product)
SLIM_END

#ifndef CPP_COMPILING
}
#endif
{'fraction_non_alphanumeric': 0.13126934984520125, 'fraction_numerical': 0.01238390092879257, 'mean_word_length': 6.804347826086956, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 35, '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': '1649780', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1123, 'n_words': 231}