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
applyToSet (tmpfileNameSet, rmTmpFiles);
}
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().
/** 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().
extern symbol *interrupts[];
extern set *publics;
extern set *tmpfileSet;
extern symbol *interrupts[];
extern set *publics;
extern set *tmpfileSet;
+
+#if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER)
+void rm_tmpfiles (void);
+#endif
{ 'C', NULL, NULL, "Preprocessor option" },
{ 'M', NULL, NULL, "Preprocessor option" },
{ 'V', NULL, &verboseExec, "Execute verbosely. Show sub commands as they are run" },
{ '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" },
{ '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" },
{ 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" },
{ 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 },
{ 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 },
#ifdef SDCC_SUB_VERSION_STR
"/" SDCC_SUB_VERSION_STR
#endif
#ifdef SDCC_SUB_VERSION_STR
"/" SDCC_SUB_VERSION_STR
#endif
-#ifdef __CYGWIN32__
- " (CYGWIN32)\n"
+#ifdef __CYGWIN__
+ " (CYGWIN)\n"
#else
#ifdef __DJGPP__
" (DJGPP) \n"
#else
#ifdef __DJGPP__
" (DJGPP) \n"
if ((!options.c1mode && !srcFileName && !nrelFiles) ||
(options.c1mode && !srcFileName && !options.out_name))
{
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);
}
printUsage ();
exit (0);
}
free (preOutName);
}
// EndFix
free (preOutName);
}
// EndFix
+ #if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER)
+ rm_tmpfiles();
+ #endif
if (cdbFile)
fclose (cdbFile);
if (cdbFile)
fclose (cdbFile);
+ if (preOutName && !options.c1mode)
+ {
+ unlink (preOutName);
+ free (preOutName);
+ }
+
if (!options.cc_only &&
!fatalError &&
!noAssemble &&
if (!options.cc_only &&
!fatalError &&
!noAssemble &&
if (yyin && yyin != stdin)
fclose (yyin);
if (yyin && yyin != stdin)
fclose (yyin);
- if (preOutName && !options.c1mode)
- {
- unlink (preOutName);
- free (preOutName);
- }
-
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#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
#warning "Cannot determine ENDIANESS of this machine assuming LITTLE_ENDIAN"
#warning "If you running sdcc on an INTEL 80x86 Platform you are okay"
#endif