picoc/cstdlib/stdbool.c

24 lines
635 B
C
Raw Normal View History

2015-06-10 15:37:21 -04:00
/* */
2015-06-17 17:57:50 -04:00
#include <stdbool.h>
#include "../interpreter.h"
static int trueValue = 1;
static int falseValue = 0;
/* structure definitions */
const char StdboolDefs[] = "typedef int bool;";
/* creates various system-dependent definitions */
void StdboolSetupFunc(Picoc *pc)
{
/* defines */
VariableDefinePlatformVar(pc, NULL, "true", &pc->IntType,
(union AnyValue*)&trueValue, false);
VariableDefinePlatformVar(pc, NULL, "false", &pc->IntType,
(union AnyValue*)&falseValue, false);
VariableDefinePlatformVar(pc, NULL, "__bool_true_false_are_defined",
&pc->IntType, (union AnyValue*)&trueValue, false);
}