adjust for mach os-x support
[fw/sdcc] / src / SDCCglue.c
index f4495e748e674783927b9e5784a507aa3a7cf9f2..115bf6622159754d6d0d4456c453bc77ed01e085 100644 (file)
@@ -192,6 +192,12 @@ emitRegularMap (memmap * map, bool addPublics, bool arFlag)
          !sym->allocreq && sym->level)
        continue;
 
+      /* for bitvar locals and parameters */
+      if (!arFlag && !sym->allocreq && sym->level 
+         && !SPEC_ABSA (sym->etype)) {
+       continue;
+      }
+
       /* if global variable & not static or extern
          and addPublics allowed then add it to the public set */
       if ((sym->level == 0 ||
@@ -1539,6 +1545,33 @@ rm_tmpfiles (void)
 }
 #endif
 
+/** Creates a temporary file name a'la tmpnam which avoids the bugs
+    in cygwin wrt c:\tmp.
+    Scans, in order: TMP, TEMP, TMPDIR, else uses tmpfile().
+*/
+char *
+tempfilename (void)
+{
+#if !defined(_MSC_VER)
+  const char *tmpdir = NULL;
+  if (getenv ("TMP"))
+    tmpdir = getenv ("TMP");
+  else if (getenv ("TEMP"))
+    tmpdir = getenv ("TEMP");
+  else if (getenv ("TMPDIR"))
+    tmpdir = getenv ("TMPDIR");
+  if (tmpdir)
+    {
+      char *name = tempnam (tmpdir, "sdcc");
+      if (name)
+       {
+          return name;
+        }
+    }
+#endif
+  return tmpnam (NULL);
+}
+
 /** 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().