From: bernhardheld Date: Sun, 12 Aug 2001 22:15:42 +0000 (+0000) Subject: Help-text corrected X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=810d021dea8f481ba97257357cd24504b21f9667;p=fw%2Fsdcc Help-text corrected delete tmp-files in case of error git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1138 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCglue.c b/src/SDCCglue.c index effbdd6f..f378ab1a 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -1512,6 +1512,15 @@ glue () applyToSet (tmpfileNameSet, rmTmpFiles); } +#if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER) +void +rm_tmpfiles (void) +{ + applyToSet (tmpfileSet, closeTmpFiles); + applyToSet (tmpfileNameSet, rmTmpFiles); +} +#endif + /** Creates a temporary file a'la tmpfile which avoids the bugs in cygwin wrt c:\tmp. Scans, in order: TMP, TEMP, TMPDIR, else uses tmpfile(). diff --git a/src/SDCCglue.h b/src/SDCCglue.h index 3d9683e7..b8a98720 100644 --- a/src/SDCCglue.h +++ b/src/SDCCglue.h @@ -36,4 +36,8 @@ void flushStatics (void); extern symbol *interrupts[]; extern set *publics; extern set *tmpfileSet; + +#if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER) +void rm_tmpfiles (void); +#endif #endif diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 1be19dfb..837f9d7d 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -131,7 +131,7 @@ optionsTable[] = { { 'C', NULL, NULL, "Preprocessor option" }, { 'M', NULL, NULL, "Preprocessor option" }, { 'V', NULL, &verboseExec, "Execute verbosely. Show sub commands as they are run" }, - { 'S', NULL, &noAssemble, "Assemble only" }, + { 'S', NULL, &noAssemble, "Compile only; do not assemble or link" }, { 'W', NULL, NULL, "Pass through options to the assembler (a) or linker (l)" }, { 'L', NULL, NULL, "Add the next field to the library search path" }, { 'l', NULL, NULL, "Include the given library in the link" }, @@ -149,7 +149,7 @@ optionsTable[] = { { 0, OPTION_NO_LOOP_IND, NULL, NULL }, { 0, "--nojtbound", &optimize.noJTabBoundary, "Don't generate boundary check for jump tables" }, { 0, "--noloopreverse", &optimize.noLoopReverse, "Disable the loop reverse optimisation" }, - { 'c', "--compile-only", &options.cc_only, "Compile only, do not assemble or link" }, + { 'c', "--compile-only", &options.cc_only, "Compile and assemble, but do not link" }, { 0, "--dumpraw", &options.dump_raw, "Dump the internal structure after the initial parse" }, { 0, "--dumpgcse", &options.dump_gcse, NULL }, { 0, "--dumploop", &options.dump_loop, NULL }, @@ -312,8 +312,8 @@ printVersionInfo () #ifdef SDCC_SUB_VERSION_STR "/" SDCC_SUB_VERSION_STR #endif -#ifdef __CYGWIN32__ - " (CYGWIN32)\n" +#ifdef __CYGWIN__ + " (CYGWIN)\n" #else #ifdef __DJGPP__ " (DJGPP) \n" @@ -1327,6 +1327,9 @@ main (int argc, char **argv, char **envp) if ((!options.c1mode && !srcFileName && !nrelFiles) || (options.c1mode && !srcFileName && !options.out_name)) { + #if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER) + rm_tmpfiles(); + #endif printUsage (); exit (0); } @@ -1391,6 +1394,9 @@ main (int argc, char **argv, char **envp) free (preOutName); } // EndFix + #if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER) + rm_tmpfiles(); + #endif return 1; } @@ -1401,6 +1407,12 @@ main (int argc, char **argv, char **envp) if (cdbFile) fclose (cdbFile); + if (preOutName && !options.c1mode) + { + unlink (preOutName); + free (preOutName); + } + if (!options.cc_only && !fatalError && !noAssemble && @@ -1416,12 +1428,6 @@ main (int argc, char **argv, char **envp) if (yyin && yyin != stdin) fclose (yyin); - if (preOutName && !options.c1mode) - { - unlink (preOutName); - free (preOutName); - } - return 0; } diff --git a/src/avr/gen.c b/src/avr/gen.c index 72dc9186..06258e4f 100644 --- a/src/avr/gen.c +++ b/src/avr/gen.c @@ -37,7 +37,7 @@ #ifdef HAVE_ENDIAN_H #include #else -#if !defined(__BORLANDC__) && !defined(_MSC_VER) && !defined(__MINGW32__) +#if !defined(__BORLANDC__) && !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__CYGWIN__) #warning "Cannot determine ENDIANESS of this machine assuming LITTLE_ENDIAN" #warning "If you running sdcc on an INTEL 80x86 Platform you are okay" #endif