Add support for WATCOMC
[pforth] / csrc / pf_main.c
index a779560..a973553 100644 (file)
@@ -66,14 +66,15 @@ int main( int argc, char **argv )
        const char *SourceName = NULL;\r
        char IfInit = FALSE;\r
        char *s;\r
        const char *SourceName = NULL;\r
        char IfInit = FALSE;\r
        char *s;\r
-       int32 i;\r
+       cell_t i;\r
        int Result;\r
 \r
 /* For Metroworks on Mac */\r
 #ifdef __MWERKS__\r
        argc = ccommand(&argv);\r
 #endif\r
        int Result;\r
 \r
 /* For Metroworks on Mac */\r
 #ifdef __MWERKS__\r
        argc = ccommand(&argv);\r
 #endif\r
-\r
+       \r
+       pfSetQuiet( FALSE );\r
 /* Parse command line. */\r
        for( i=1; i<argc; i++ )\r
        {\r
 /* Parse command line. */\r
        for( i=1; i<argc; i++ )\r
        {\r
@@ -97,8 +98,8 @@ int main( int argc, char **argv )
                                \r
                        case 'd':\r
                                if( *s != '\0' ) DicName = s;\r
                                \r
                        case 'd':\r
                                if( *s != '\0' ) DicName = s;\r
-                               // Allow space after -d (Thanks Aleksej Saushev)\r
-                               // Make sure there is another argument.\r
+                               /* Allow space after -d (Thanks Aleksej Saushev) */\r
+                               /* Make sure there is another argument. */\r
                                else if( (i+1) < argc )\r
                                {\r
                                        DicName = argv[++i];\r
                                else if( (i+1) < argc )\r
                                {\r
                                        DicName = argv[++i];\r
@@ -128,6 +129,14 @@ int main( int argc, char **argv )
        DicName = NULL;\r
 #endif\r
 \r
        DicName = NULL;\r
 #endif\r
 \r
+#ifdef PF_UNIT_TEST\r
+       if( (Result = pfUnitTest()) != 0 )\r
+       {\r
+               ERR(("pForth stopping on unit test failure.\n"));\r
+               goto on_error;\r
+       }\r
+#endif\r
+       \r
        Result = pfDoForth( DicName, SourceName, IfInit);\r
 \r
 on_error:\r
        Result = pfDoForth( DicName, SourceName, IfInit);\r
 \r
 on_error:\r