From 65b4e1a8afb98d9b28f116cedcee9956f0730f1f Mon Sep 17 00:00:00 2001 From: Evan Hunter Date: Sat, 8 Oct 2016 11:31:53 +0100 Subject: [PATCH] Fix C++ compatibility Compiling for C++ (as is needed for Metakit extension) generates an error due to the use of the reserved word 'template' as an argument name. Renaming this argument --- jim-aio.c | 6 +++--- jim.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jim-aio.c b/jim-aio.c index 0631e40..b9eb441 100644 --- a/jim-aio.c +++ b/jim-aio.c @@ -1902,14 +1902,14 @@ static int JimAioSockCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) * On success, leaves the filename in the interpreter result, otherwise * leaves an error message. */ -int Jim_MakeTempFile(Jim_Interp *interp, const char *template) +int Jim_MakeTempFile(Jim_Interp *interp, const char *filename_template) { #ifdef HAVE_MKSTEMP int fd; mode_t mask; Jim_Obj *filenameObj; - if (template == NULL) { + if (filename_template == NULL) { const char *tmpdir = getenv("TMPDIR"); if (tmpdir == NULL || *tmpdir == '\0' || access(tmpdir, W_OK) != 0) { tmpdir = "/tmp/"; @@ -1921,7 +1921,7 @@ int Jim_MakeTempFile(Jim_Interp *interp, const char *template) Jim_AppendString(interp, filenameObj, "tcl.tmp.XXXXXX", -1); } else { - filenameObj = Jim_NewStringObj(interp, template, -1); + filenameObj = Jim_NewStringObj(interp, filename_template, -1); } /* Update the template name directly with the filename */ diff --git a/jim.h b/jim.h index 183f970..4719292 100644 --- a/jim.h +++ b/jim.h @@ -608,7 +608,7 @@ JIM_EXPORT char *Jim_StrDupLen(const char *s, int l); /* environment */ JIM_EXPORT char **Jim_GetEnviron(void); JIM_EXPORT void Jim_SetEnviron(char **env); -JIM_EXPORT int Jim_MakeTempFile(Jim_Interp *interp, const char *template); +JIM_EXPORT int Jim_MakeTempFile(Jim_Interp *interp, const char *filename_template); /* evaluation */ JIM_EXPORT int Jim_Eval(Jim_Interp *interp, const char *script); -- 2.11.4.GIT