NULL
};
-static const char *_preCmd = "{cpp} -nostdinc -Wall -std=c99 {cppextraopts} \"{fullsrcfilename}\" \"{cppoutfilename}\"";
+static const char *_preCmd = "{cpp} -nostdinc -Wall {cppstd}{cppextraopts} \"{fullsrcfilename}\" \"{cppoutfilename}\"";
PORT *port;
if (options.float_rent)
addSet(&preArgvSet, Safe_strdup("-DSDCC_FLOAT_REENT"));
- /* set macro corresponding to compiler option */
- if (options.parms_in_bank1)
- addSet(&preArgvSet, Safe_strdup("-DSDCC_PARMS_IN_BANK1"));
-
/* add SDCC version number */
{
char buf[20];
/* standard include path */
if (!options.nostdinc) {
- inclList = appendStrSet(includeDirsSet, "-I\"", "\"");
+ inclList = appendStrSet(includeDirsSet, "-isystem \"", "\"");
mergeSets(&preArgvSet, inclList);
}
setMainValue ("linkdstfilename", "{stdlinkdstfilename}");
}
+ /*
+ * Make sure the preprocessor is called with the "-std" option
+ * corresponding to the --std used to start sdcc
+ */
+ if (options.std_c99)
+ {
+ if (!options.std_sdcc)
+ setMainValue ("cppstd", "-std=c99 ");
+ }
+ else
+ {
+ if (!options.std_sdcc)
+ setMainValue ("cppstd", "-std=c89 ");
+ }
}
static void doPrintSearchDirs(void)