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(); Initialise();
if (PlatformSetExitPoint()) if (PlatformSetExitPoint())
return 1; return 1;
PlatformScanFile(argv[1]); PlatformScanFile(argv[1]);
return 0; return 0;
} }
#else #else
# ifdef SURVEYOR_HOST # ifdef SURVEYOR_HOST
static char *SourceStr = "\ static char *SourceStr = "\n\
printf(\"This is a test program\n\");\ int Count;\n\
for (Count = 1; Count <= 10; Count++)\ \n\
printf(\"%d\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(); Initialise();
if (PlatformSetExitPoint())
return 1;
Parse("test.c", SourceStr, strlen(SourceStr), TRUE); Parse("test.c", SourceStr, strlen(SourceStr), TRUE);
return 0; return 0;
} }

View file

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