* device/include/pic16/pic18f*.h: add bit aliases in INTCONbits_t
[fw/sdcc] / src / SDCCmain.c
index fd52d5920beb95903d9167125226e85b8c49c391..12909d3b01abdb824a3eb09c0f60bd690b8c5223 100644 (file)
@@ -283,7 +283,7 @@ static const char *_baseValues[] = {
   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;
 
@@ -2022,10 +2022,6 @@ preProcess (char **envp)
       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];
@@ -2053,7 +2049,7 @@ preProcess (char **envp)
 
       /* standard include path */
       if (!options.nostdinc) {
-        inclList = appendStrSet(includeDirsSet, "-I\"", "\"");
+        inclList = appendStrSet(includeDirsSet, "-isystem \"", "\"");
         mergeSets(&preArgvSet, inclList);
       }
 
@@ -2258,6 +2254,20 @@ initValues (void)
       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)