diff options
author | Evan Hunter <evan@ozhiker.com> | 2016-10-08 11:31:53 +0100 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-10-09 09:39:03 +1000 |
commit | 65b4e1a8afb98d9b28f116cedcee9956f0730f1f (patch) | |
tree | c8e650ab8763966b8155af3daf4d56ce5a6af4c4 | |
parent | f5e2c517999777060b8dfc1baf38c67cac5702e7 (diff) | |
download | jimtcl-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.c | 6 | ||||
-rw-r--r-- | jim.h | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -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 */ @@ -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); |