From: mpech Date: Tue, 26 Jul 2011 14:14:14 +0000 (+0200) Subject: tmpnam_s for windows X-Git-Tag: v1.3.0~253^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=2ef58187d82c31a649104997c2038b07fb887732;p=clitk.git tmpnam_s for windows --- diff --git a/tests/tools/toolTestRunner.cxx b/tests/tools/toolTestRunner.cxx index 89deab5..7237c68 100644 --- a/tests/tools/toolTestRunner.cxx +++ b/tests/tools/toolTestRunner.cxx @@ -35,11 +35,13 @@ int getOutputOptionIndex(int argc, char** argv){ } std::string getTmpFileName(){ - char fileName[] = "/tmp/vvTempXXXXXX"; + #ifdef _WIN32 - errno_t err = tmpfile_s(&fileName, strlen(fileName)); + char fileName[L_tmpnam_s]; + errno_t err = tmpnam_s(fileName); #else + char fileName[] = "/tmp/vvTempXXXXXX"; int err=0; int fd = mkstemp(fileName); if(fd==-1) err=1;