diff --git a/makefile b/makefile index a4387a5..8fb50fe 100644 --- a/makefile +++ b/makefile @@ -28,10 +28,10 @@ library: $(TOY_OUTDIR) static: $(TOY_OUTDIR) $(MAKE) -j8 -C source static -library-release: $(TOY_OUTDIR) +library-release: clean $(TOY_OUTDIR) $(MAKE) -j8 -C source library-release -static-release: $(TOY_OUTDIR) +static-release: clean $(TOY_OUTDIR) $(MAKE) -j8 -C source static-release #utils diff --git a/source/toy_common.c b/source/toy_common.c index 7e1f2ac..8aed259 100644 --- a/source/toy_common.c +++ b/source/toy_common.c @@ -4,7 +4,7 @@ #include #include -//test variable sizes based on platform +//test variable sizes based on platform - see issue #35 #define STATIC_ASSERT(test_for_true) static_assert((test_for_true), "(" #test_for_true ") failed") STATIC_ASSERT(sizeof(char) == 1); @@ -15,6 +15,8 @@ STATIC_ASSERT(sizeof(unsigned char) == 1); STATIC_ASSERT(sizeof(unsigned short) == 2); STATIC_ASSERT(sizeof(unsigned int) == 4); +#ifndef TOY_EXPORT + //declare the singleton with default values Toy_CommandLine Toy_commandLine = { .error = false, @@ -134,3 +136,5 @@ void Toy_copyrightCommandLine(int argc, const char* argv[]) { printf("2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n\n"); printf("3. This notice may not be removed or altered from any source distribution.\n\n"); } + +#endif diff --git a/source/toy_common.h b/source/toy_common.h index ef18c43..f5edab5 100644 --- a/source/toy_common.h +++ b/source/toy_common.h @@ -28,7 +28,9 @@ #endif -//for processing the command line arguments +#ifndef TOY_EXPORT + +//for processing the command line arguments in the repl typedef struct { bool error; bool help; @@ -51,3 +53,5 @@ TOY_API void Toy_initCommandLine(int argc, const char* argv[]); TOY_API void Toy_usageCommandLine(int argc, const char* argv[]); TOY_API void Toy_helpCommandLine(int argc, const char* argv[]); TOY_API void Toy_copyrightCommandLine(int argc, const char* argv[]); + +#endif \ No newline at end of file diff --git a/source/toy_interpreter.c b/source/toy_interpreter.c index 7dae301..f11f791 100644 --- a/source/toy_interpreter.c +++ b/source/toy_interpreter.c @@ -12,12 +12,17 @@ #include static void printWrapper(const char* output) { + //allow for disabling of newlines in the repl +#ifndef TOY_EXPORT if (Toy_commandLine.enablePrintNewline) { printf("%s\n", output); } else { printf("%s", output); } +#else + printf("%s\n", output); +#endif } static void assertWrapper(const char* output) {