From fd3fad1784d6821f440d66ffdc2137f8822ae71f Mon Sep 17 00:00:00 2001 From: "zik.saleeba" Date: Mon, 5 Jul 2010 05:48:58 +0000 Subject: [PATCH] Added missing file git-svn-id: http://picoc.googlecode.com/svn/trunk@459 21eae674-98b7-11dd-bd71-f92a316d2d60 --- cstdlib/stdbool.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cstdlib/stdbool.c diff --git a/cstdlib/stdbool.c b/cstdlib/stdbool.c new file mode 100644 index 0000000..80fc915 --- /dev/null +++ b/cstdlib/stdbool.c @@ -0,0 +1,22 @@ +/* string.h library for large systems - small embedded systems use clibrary.c instead */ +#include "../picoc.h" + +#ifndef BUILTIN_MINI_STDLIB + +static int trueValue = 1; +static int falseValue = 0; + + +/* structure definitions */ +const char StdboolDefs[] = "typedef int bool;"; + +/* creates various system-dependent definitions */ +void StdboolSetupFunc(void) +{ + /* defines */ + VariableDefinePlatformVar(NULL, "true", &IntType, (union AnyValue *)&trueValue, FALSE); + VariableDefinePlatformVar(NULL, "false", &IntType, (union AnyValue *)&falseValue, FALSE); + VariableDefinePlatformVar(NULL, "__bool_true_false_are_defined", &IntType, (union AnyValue *)&trueValue, FALSE); +} + +#endif /* !BUILTIN_MINI_STDLIB */