emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 5d0b45cd67b: Make the native compiler always use `make-temp-fil


From: Andrea Corallo
Subject: emacs-29 5d0b45cd67b: Make the native compiler always use `make-temp-file' for temporary files
Date: Mon, 20 Feb 2023 15:16:51 -0500 (EST)

branch: emacs-29
commit 5d0b45cd67b383bc777dcf7589517e51e58f5a21
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Make the native compiler always use `make-temp-file' for temporary files
    
    * src/comp.c (CALL4I): Define macro.
    (Fcomp__compile_ctxt_to_file): Use `make-temp-file' instead of
    `make-temp-file-internal'.
    * lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Likewise.
---
 lisp/emacs-lisp/comp.el | 4 ++--
 src/comp.c              | 7 ++++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index a2bad6ce6a8..a0b18ea864f 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -3813,8 +3813,8 @@ Return the trampoline if found or nil otherwise."
    ;; found.
    finally (cl-return
             (expand-file-name
-             (make-temp-file-internal (file-name-sans-extension rel-filename)
-                                      0 ".eln" nil)
+             (make-temp-file (file-name-sans-extension rel-filename) 0 ".eln"
+                             nil)
              temporary-file-directory))))
 
 (defun comp-trampoline-compile (subr-name)
diff --git a/src/comp.c b/src/comp.c
index beaf443a0f7..1fce108fea4 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -514,6 +514,10 @@ load_gccjit_if_necessary (bool mandatory)
 #define CALL2I(fun, arg1, arg2)                                \
   CALLN (Ffuncall, intern_c_string (STR (fun)), arg1, arg2)
 
+/* Like call4 but stringify and intern.  */
+#define CALL4I(fun, arg1, arg2, arg3, arg4)                            \
+  CALLN (Ffuncall, intern_c_string (STR (fun)), arg1, arg2, arg3, arg4)
+
 #define DECL_BLOCK(name, func)                         \
   gcc_jit_block *(name) =                              \
     gcc_jit_function_new_block ((func), STR (name))
@@ -4991,7 +4995,8 @@ DEFUN ("comp--compile-ctxt-to-file", 
Fcomp__compile_ctxt_to_file,
       format_string ("%s_libgccjit_repro.c", SSDATA (ebase_name)));
 
   Lisp_Object tmp_file =
-    Fmake_temp_file_internal (base_name, Qnil, build_string (".eln.tmp"), 
Qnil);
+    CALL4I (make-temp-file, base_name, Qnil, build_string (".eln.tmp"), Qnil);
+
   Lisp_Object encoded_tmp_file = ENCODE_FILE (tmp_file);
 #ifdef WINDOWSNT
   encoded_tmp_file = ansi_encode_filename (encoded_tmp_file);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]