diff --git a/source/toy.h b/source/toy.h new file mode 100644 index 0000000..1b1cdfd --- /dev/null +++ b/source/toy.h @@ -0,0 +1,10 @@ +#pragma once + +//general utilities +#include "toy_common.h" + +//building blocks +// + +//pipeline +// diff --git a/source/toy_common.c b/source/toy_common.c new file mode 100644 index 0000000..efa91bc --- /dev/null +++ b/source/toy_common.c @@ -0,0 +1,8 @@ +#include "toy_common.h" + +//defined separately, as compilation can take several seconds, invalidating the comparisons of __TIME__ +static const char* build = __DATE__ " " __TIME__ ";development branch"; + +const char* Toy_private_version_build() { + return build; +} diff --git a/source/toy_common.h b/source/toy_common.h new file mode 100644 index 0000000..95fd677 --- /dev/null +++ b/source/toy_common.h @@ -0,0 +1,37 @@ +#pragma once + +//for specified type sizes +#include +#include +#include + + +//TOY_API is platform-dependant, and marks publicly usable API functions +#if defined(__linux__) || defined(__MINGW32__) || defined(__GNUC__) + +//GCC support +#define TOY_API extern + +#elif defined(_MSC_VER) + +//MSVC support +#ifndef TOY_EXPORT +#define TOY_API __declspec(dllimport) +#else +#define TOY_API __declspec(dllexport) +#endif + +#else + +//generic +#define TOY_API extern + +#endif + +//bytecode version specifiers +#define TOY_VERSION_MAJOR 2 +#define TOY_VERSION_MINOR 0 +#define TOY_VERSION_PATCH 0 +#define TOY_VERSION_BUILD Toy_private_version_build() +TOY_API const char* Toy_private_version_build(); +