Fixed test program for Surveyor

git-svn-id: http://picoc.googlecode.com/svn/trunk@122 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2009-02-28 05:49:14 +00:00
parent 6ce1662475
commit 9f8770047f
2 changed files with 12 additions and 9 deletions

17
picoc.c
View file

@ -23,22 +23,27 @@ int main(int argc, char **argv)
Initialise();
if (PlatformSetExitPoint())
return 1;
PlatformScanFile(argv[1]);
return 0;
}
#else
# ifdef SURVEYOR_HOST
static char *SourceStr = "\
printf(\"This is a test program\n\");\
for (Count = 1; Count <= 10; Count++)\
printf(\"%d\n\");\
static char *SourceStr = "\n\
int Count;\n\
\n\
printf(\"This is a test program\n\");\n\
for (Count = 1; Count <= 10; Count++)\n\
printf(\"%d\n\", Count);\n\
";
int main(int argc, char **argv)
int picoc()
{
Initialise();
if (PlatformSetExitPoint())
return 1;
Parse("test.c", SourceStr, strlen(SourceStr), TRUE);
return 0;
}

View file

@ -2,9 +2,6 @@
#ifndef PLATFORM_H
#define PLATFORM_H
/* common includes */
#include <stdarg.h>
/* configurable options */
#define UNIX_HOST /* select your host type */
#undef FLYINGFOX_HOST
@ -31,6 +28,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdarg.h>
#ifndef NO_FP
#include <math.h>
#endif