aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Hunter <evan@ozhiker.com>2016-10-08 11:31:53 +0100
committerSteve Bennett <steveb@workware.net.au>2016-10-09 09:39:03 +1000
commit65b4e1a8afb98d9b28f116cedcee9956f0730f1f (patch)
treec8e650ab8763966b8155af3daf4d56ce5a6af4c4
parentf5e2c517999777060b8dfc1baf38c67cac5702e7 (diff)
downloadjimtcl-65b4e1a8afb98d9b28f116cedcee9956f0730f1f.zip
jimtcl-65b4e1a8afb98d9b28f116cedcee9956f0730f1f.tar.gz
jimtcl-65b4e1a8afb98d9b28f116cedcee9956f0730f1f.tar.bz2
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
-rw-r--r--jim-aio.c6
-rw-r--r--jim.h2
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);