undo Johan's changes for the moment
[fw/sdcc] / src / SDCCglue.c
index f07bcb74446f4178ccc16de54bae0a2dd3091884..901d291136e7482890f811552a7e59218321cb5e 100644 (file)
@@ -25,6 +25,7 @@
 #include "common.h"
 #include "asm.h"
 #include <time.h>
+#include "newalloc.h"
 
 #if    !defined(__BORLANDC__) && !defined(_MSC_VER)
 #if 0 /* This should no longer be necessary. */
@@ -121,7 +122,7 @@ char *aopLiteralLong(value *val, int offset, int size)
            /* Hmm.  Too big for now. */
            assert(0);
        }
-        ALLOC_ATOMIC(rs,strlen(buffer)+1);
+        rs = Safe_calloc(strlen(buffer)+1);
         return strcpy (rs,buffer);
     }
 
@@ -135,7 +136,7 @@ char *aopLiteralLong(value *val, int offset, int size)
 #else
     tsprintf(buffer, "!immedbyte", fl.c[offset]);
 #endif
-    ALLOC_ATOMIC(rs,strlen(buffer)+1);
+    rs = Safe_calloc(strlen(buffer)+1);
     return strcpy (rs,buffer);
 }
 
@@ -1350,6 +1351,7 @@ void glue ()
 */
 FILE *tempfile(void)
 {
+#if !defined(_MSC_VER)
     const char *tmpdir = NULL;
     if (getenv("TMP"))
        tmpdir = getenv("TMP");
@@ -1369,13 +1371,14 @@ FILE *tempfile(void)
        }
        return NULL;
     }
+#endif
     return tmpfile();
 }
 
 char *gc_strdup(const char *s)
 {
     char *ret;
-    ALLOC_ATOMIC(ret, strlen(s)+1);
+    ret = Safe_calloc(strlen(s)+1);
     strcpy(ret, s);
     return ret;
 }