Skip to content

Commit 5d0b45c

Browse files
committed
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.
1 parent 88ee92e commit 5d0b45c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lisp/emacs-lisp/comp.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3813,8 +3813,8 @@ Return the trampoline if found or nil otherwise."
38133813
;; found.
38143814
finally (cl-return
38153815
(expand-file-name
3816-
(make-temp-file-internal (file-name-sans-extension rel-filename)
3817-
0 ".eln" nil)
3816+
(make-temp-file (file-name-sans-extension rel-filename) 0 ".eln"
3817+
nil)
38183818
temporary-file-directory))))
38193819

38203820
(defun comp-trampoline-compile (subr-name)

src/comp.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,10 @@ load_gccjit_if_necessary (bool mandatory)
514514
#define CALL2I(fun, arg1, arg2) \
515515
CALLN (Ffuncall, intern_c_string (STR (fun)), arg1, arg2)
516516

517+
/* Like call4 but stringify and intern. */
518+
#define CALL4I(fun, arg1, arg2, arg3, arg4) \
519+
CALLN (Ffuncall, intern_c_string (STR (fun)), arg1, arg2, arg3, arg4)
520+
517521
#define DECL_BLOCK(name, func) \
518522
gcc_jit_block *(name) = \
519523
gcc_jit_function_new_block ((func), STR (name))
@@ -4991,7 +4995,8 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
49914995
format_string ("%s_libgccjit_repro.c", SSDATA (ebase_name)));
49924996

49934997
Lisp_Object tmp_file =
4994-
Fmake_temp_file_internal (base_name, Qnil, build_string (".eln.tmp"), Qnil);
4998+
CALL4I (make-temp-file, base_name, Qnil, build_string (".eln.tmp"), Qnil);
4999+
49955000
Lisp_Object encoded_tmp_file = ENCODE_FILE (tmp_file);
49965001
#ifdef WINDOWSNT
49975002
encoded_tmp_file = ansi_encode_filename (encoded_tmp_file);

0 commit comments

Comments
 (0)