<commit_before>/*
 * TTBlue Base Class
 * Copyright © 2008, <NAME>
 *
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html
 */

#ifndef __TT_ELEMENT_H__
#define __TT_ELEMENT_H__

// Platform Sniffing
// Ideally the platform would already be set with a -D option to gcc...
#ifndef TT_PLATFORM_LINUX
	#ifndef TT_PLATFORM_WIN
		#ifdef WIN_VERSION
			#define TT_PLATFORM_WIN
		#else
			#define TT_PLATFORM_MAC
		#endif
	#endif
#endif

#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;

#ifdef TT_PLATFORM_LINUX
#include <stdarg.h>
#include <string.h>
#endif

#ifdef TT_PLATFORM_WIN
	#include "windows.h"
	#ifndef _CRT_SECURE_NO_WARNINGS
		#define _CRT_SECURE_NO_WARNINGS
	#endif
	#define snprintf _snprintf
	#ifdef TTFOUNDATION_EXPORTS
		#define TTFOUNDATION_EXPORT __declspec(dllexport)
	#else
		#ifdef TTSTATIC
			#define TTFOUNDATION_EXPORT
		#else
			#define TTFOUNDATION_EXPORT __declspec(dllimport)
		#endif
	#endif // _DLL_EXPORT

#else // TT_PLATFORM_MAC
	#ifdef TTFOUNDATION_EXPORTS
		#define TTFOUNDATION_EXPORT __attribute__((visibility("default")))
	#else
		#define TTFOUNDATION_EXPORT
	#endif
#endif


#ifndef NO
#define NO 0
#endif

#ifndef YES
#define YES 1
#endif


#ifdef TT_DEBUG
#define TT_ENABLE_ASSERTIONS
#endif

#ifdef TT_ENABLE_ASSERTIONS
#define TT_ASSERT(name, result) \
				if(!result){\
					char* nullPtr = 0;\
					TTLogError("%s:%ld ASSERTION %s FAILED\n", __FILE__, __LINE__, #name );\
					*nullPtr = 1;\
				}
#else
#define TT_ASSERT(name, result) ((void)(0));
#endif


/****************************************************************************************************/
// Type Definitions

typedef bool				TTBoolean;			// same as Boolean on the Mac
typedef char*				TTCString;
typedef const char*			TTImmutableCString;
typedef std::string			TTString;

typedef signed char			TTInt8;
typedef unsigned char		TTUInt8;
typedef signed				TTInt16;
typedef unsigned short		TTUInt16;
typedef signed long			TTInt32;
typedef unsigned long		TTUInt32;

#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64				TTInt64;
typedef unsigned __int64	TTUInt64;
#else
typedef signed long long	TTInt64;
typedef unsigned long long	TTUInt64;
#endif

typedef float				TTFloat32;
typedef double				TTFloat64;

/** A value representing a single audio sample.  TTSampleValue should be used any place a sample value is what the value represents.  This will enable us to change the type in the future if needed.  For example, to use 64-bit floats. */
typedef TTFloat64			TTSampleValue;
/** A TTSampleVector is simply a pointer to the first of an array of TTSampleValues. */
typedef TTSampleValue*		TTSampleVector;

/** An integer that is the same size as a pointer. */
typedef long				TTPtrSizedInt;

/** A generic pointer. */
typedef void*				TTPtr;

/****************************************************************************************************/

/**	TTBlue Data Types
 *	Enumeration of data types used through out TTBlue, including the TTValue class and declaring the types of
 *	TTAttribute objects.																			*/
enum TTDataType{
	kTypeNone = 0,
	kTypeFloat32,
	kTypeFloat64,
	kTypeInt8,
	kTypeUInt8,
	kTypeInt16,
	kTypeUInt16,
	kTypeInt32,
	kTypeUInt32,
	kTypeInt64,
	kTypeUInt64,
	kTypeBoolean,
	kTypeSymbol,
	kTypeObject,
	kTypePointer,<commit_msg>TT type definitions updated to work for 64-bit binaries on the Mac.<commit_after>/*
 * TTBlue Base Class
 * Copyright © 2008, <NAME>
 *
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html
 */

#ifndef __TT_ELEMENT_H__
#define __TT_ELEMENT_H__

// Platform Sniffing
// Ideally the platform would already be set with a -D option to gcc...
#ifndef TT_PLATFORM_LINUX
	#ifndef TT_PLATFORM_WIN
		#ifdef WIN_VERSION
			#define TT_PLATFORM_WIN
		#else
			#define TT_PLATFORM_MAC
		#endif
	#endif
#endif

#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;

#ifdef TT_PLATFORM_LINUX
#include <stdarg.h>
#include <string.h>
#endif

#ifdef TT_PLATFORM_WIN
	#include "windows.h"
	#ifndef _CRT_SECURE_NO_WARNINGS
		#define _CRT_SECURE_NO_WARNINGS
	#endif
	#define snprintf _snprintf
	#ifdef TTFOUNDATION_EXPORTS
		#define TTFOUNDATION_EXPORT __declspec(dllexport)
	#else
		#ifdef TTSTATIC
			#define TTFOUNDATION_EXPORT
		#else
			#define TTFOUNDATION_EXPORT __declspec(dllimport)
		#endif
	#endif // _DLL_EXPORT

#else // TT_PLATFORM_MAC
	#ifdef TTFOUNDATION_EXPORTS
		#define TTFOUNDATION_EXPORT __attribute__((visibility("default")))
	#else
		#define TTFOUNDATION_EXPORT
	#endif
#endif


#ifndef NO
#define NO 0
#endif

#ifndef YES
#define YES 1
#endif


#ifdef TT_DEBUG
#define TT_ENABLE_ASSERTIONS
#endif

#ifdef TT_ENABLE_ASSERTIONS
#define TT_ASSERT(name, result) \
				if(!result){\
					char* nullPtr = 0;\
					TTLogError("%s:%ld ASSERTION %s FAILED\n", __FILE__, __LINE__, #name );\
					*nullPtr = 1;\
				}
#else
#define TT_ASSERT(name, result) ((void)(0));
#endif


/****************************************************************************************************/
// Type Definitions

// Note http://developer.apple.com/mac/library/documentation/Darwin/Conceptual/64bitPorting/MakingCode64-BitClean/MakingCode64-BitClean.html#//apple_ref/doc/uid/TP40001064-CH226-SW2

typedef bool				TTBoolean;			// same as Boolean on the Mac
typedef char*				TTCString;
typedef const char*			TTImmutableCString;
typedef std::string			TTString;

typedef signed char			TTInt8;
typedef unsigned char		TTUInt8;
typedef signed				TTInt16;
typedef unsigned short		TTUInt16;

#ifdef __LP64__		// Mac 64-bit
	typedef signed int			TTInt32;
	typedef unsigned int		TTUInt32;
#else				// Mac 32-bit, Win32 32-bit
	typedef signed long			TTInt32;
	typedef unsigned long		TTUInt32;
#endif

#if defined(_MSC_VER) || defined(__BORLANDC__)
	typedef __int64				TTInt64;
	typedef unsigned __int64	TTUInt64;
#else if defined(__LP64__)	// Mac 64-bit
	typedef signed long			TTInt64;
	typedef unsigned long		TTUInt64;
#else // Max 32-bit
	typedef signed long long	TTInt64;
	typedef unsigned long long	TTUInt64;
#endif

typedef float				TTFloat32;
typedef double				TTFloat64;

/** A value representing a single audio sample.  TTSampleValue should be used any place a sample value is what the value represents.  This will enable us to change the type in the future if needed.  For example, to use 64-bit floats. */
typedef TTFloat64			TTSampleValue;
/** A TTSampleVector is simply a pointer to the first of an array of TTSampleValues. */
typedef TTSampleValue*		TTSampleVector;

/** An integer that is the same size as a pointer.	*/
typedef long				TTPtrSizedInt;				// this works for both 32 and 64 bit code on the Mac

/** A generic pointer. */
typedef void*				TTPtr;

/****************************************************************************************************/

/**	TTBlue Data Types
 *	Enumeration of data types used through out TTBlue, including the TTValue class and declaring the types of
 *	TTAttribute objects.																			*/
enum TTDataType{
	kTypeNone = 0,
	kTypeFloat32,
	kTypeFloat64,
	kTypeInt8,
	kTypeUInt8,
	kTypeInt16,
	kTypeUInt16,
	kTypeInt32,
	kTypeUInt32,
	kTypeInt64,
	kTypeUInt64,
	kTypeBoolean,
	kTypeSymbol,
	kTypeObject,
	kTypePointer,
{'fraction_non_alphanumeric': 0.13396739130434782, 'fraction_numerical': 0.022282608695652174, 'mean_word_length': 4.4485566247224275, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4123971', 'n_tokens_mistral': 2892, 'n_tokens_neox': 2421, 'n_words': 751}