X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCmain.c;h=ac9385656809bc1652edb44083c02b23afe3bf5f;hb=8b40d36f8024802d5d99882bd58491130d260b38;hp=222acfc21abc5622656cf5dfe6ec7c091b7e04aa;hpb=742f16c4143dc494232d0138b78e0ca63aefc7d2;p=fw%2Fsdcc diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 222acfc2..ac938565 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -262,8 +262,10 @@ optionsTable[] = { { 0, OPTION_STACK_LOC, NULL, " Stack pointer initial value" }, { 0, OPTION_DATA_LOC, NULL, " Direct data start location" }, { 0, OPTION_IDATA_LOC, NULL, NULL }, +#if !OPT_DISABLE_DS390 || !OPT_DISABLE_MCS51 || !OPT_DISABLE_PIC + { 0, OPTION_STACK_SIZE, NULL,"MCS51/DS390/PIC - Tells the linker to allocate this space for stack"}, +#endif #if !OPT_DISABLE_DS390 || !OPT_DISABLE_MCS51 - { 0, OPTION_STACK_SIZE, NULL,"MCS51/DS390 - Tells the linker to allocate this space for stack"}, { 0, OPTION_PACK_IRAM, NULL,"MCS51/DS390 - Tells the linker to pack variables in internal ram (default)"}, { 0, OPTION_NO_PACK_IRAM, &options.no_pack_iram,"MCS51/DS390 - Tells the linker not to pack variables in internal ram"}, #endif @@ -710,7 +712,7 @@ getStringArg(const char *szStart, char **argv, int *pi, int argc) { werror (E_ARGUMENT_MISSING, szStart); /* Die here rather than checking for errors later. */ - exit(-1); + exit(EXIT_FAILURE); } else { @@ -1530,14 +1532,14 @@ linkEdit (char **envp) /* data segment start. If zero, the linker chooses the best place for data */ - if(options.data_loc) + if (options.data_loc) { WRITE_SEG_LOC (DATA_NAME, options.data_loc); } /* xdata segment start. If zero, the linker chooses the best place for xdata */ - if(options.xdata_loc) + if (options.xdata_loc) { WRITE_SEG_LOC (XDATA_NAME, options.xdata_loc); } @@ -1617,7 +1619,7 @@ linkEdit (char **envp) fprintf(stderr, "Add support for your FLAT24 target in %s @ line %d\n", __FILE__, __LINE__); - exit(-1); + exit(EXIT_FAILURE); } break; case MODEL_PAGE0: @@ -1665,7 +1667,7 @@ linkEdit (char **envp) fprintf(stderr, "Add support for your FLAT24 target in %s @ line %d\n", __FILE__, __LINE__); - exit(-1); + exit(EXIT_FAILURE); } } #endif @@ -1830,6 +1832,13 @@ linkEdit (char **envp) /* if (options.verbose)fprintf(stderr, "linker command line: %s\n", buffer); */ system_ret = my_system (buffer); + +#ifdef _WIN32 + #define STRCMP stricmp +#else + #define STRCMP strcmp +#endif + /* TODO: most linker don't have a -o parameter */ /* -o option overrides default name? */ if (fullDstFileName) @@ -1858,8 +1867,8 @@ linkEdit (char **envp) strncatz (scratchFileName, options.out_fmt ? ".S19" : ".ihx", sizeof(scratchFileName)); - if (strcmp (fullDstFileName, scratchFileName)) - unlink (fullDstFileName); + if (STRCMP (fullDstFileName, scratchFileName)) + remove (fullDstFileName); rename (scratchFileName, fullDstFileName); strncpyz (buffer, fullDstFileName, sizeof(buffer)); @@ -1874,15 +1883,15 @@ linkEdit (char **envp) strncatz (scratchFileName, ".map", sizeof(scratchFileName)); *q = 0; strncatz(buffer, ".map", sizeof(buffer)); - if (strcmp (scratchFileName, buffer)) - unlink (buffer); + if (STRCMP (scratchFileName, buffer)) + remove (buffer); rename (scratchFileName, buffer); *p = 0; strncatz (scratchFileName, ".mem", sizeof(scratchFileName)); *q = 0; strncatz(buffer, ".mem", sizeof(buffer)); - if (strcmp (scratchFileName, buffer)) - unlink (buffer); + if (STRCMP (scratchFileName, buffer)) + remove (buffer); rename (scratchFileName, buffer); if (options.debug) { @@ -1890,14 +1899,14 @@ linkEdit (char **envp) strncatz (scratchFileName, ".cdb", sizeof(scratchFileName)); *q = 0; strncatz(buffer, ".cdb", sizeof(buffer)); - if (strcmp (scratchFileName, buffer)) - unlink (buffer); + if (STRCMP (scratchFileName, buffer)) + remove (buffer); rename (scratchFileName, buffer); /* and the OMF file without extension: */ *p = 0; *q = 0; - if (strcmp (scratchFileName, buffer)) - unlink (buffer); + if (STRCMP (scratchFileName, buffer)) + remove (buffer); rename (scratchFileName, buffer); } } @@ -1950,7 +1959,7 @@ assemble (char **envp) port->linker.rel_ext, sizeof(scratchFileName)); if (strcmp (scratchFileName, fullDstFileName)) - unlink (fullDstFileName); + remove (fullDstFileName); rename (scratchFileName, fullDstFileName); } } @@ -2313,7 +2322,7 @@ main (int argc, char **argv, char **envp) atexit(rm_tmpfiles); /* install signal handler; - it's only purpuse is to call exit() to remove temp files */ + it's only purpose is to call exit() to remove temp files */ if (!getenv("SDCC_LEAVE_SIGNALS")) { signal (SIGABRT, sig_handler);