From 96276c847a5c266f9f51f3ec4ece8fe3f1381c96 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 12 Mar 2012 11:51:16 +0100 Subject: Made creation of temp files interprocess safe in windows Fixes for 64-bit compilation Implemented realpath function Improved auodep scanning Solved a problem in dependency scanning --- tools/mhmake/src/functions.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tools/mhmake/src/functions.cpp') diff --git a/tools/mhmake/src/functions.cpp b/tools/mhmake/src/functions.cpp index 1071d2604..7393035cf 100644 --- a/tools/mhmake/src/functions.cpp +++ b/tools/mhmake/src/functions.cpp @@ -41,6 +41,7 @@ funcdef mhmakefileparser::m_FunctionsDef[]= { ,{"dir", &mhmakefileparser::f_dir} ,{"shell", &mhmakefileparser::f_shell} ,{"relpath", &mhmakefileparser::f_relpath} + ,{"realpath", &mhmakefileparser::f_realpath} ,{"toupper", &mhmakefileparser::f_toupper} ,{"tolower", &mhmakefileparser::f_tolower} ,{"exist", &mhmakefileparser::f_exist} @@ -828,6 +829,24 @@ string mhmakefileparser::f_relpath(const string & FileNames) const return IterList(ExpandExpression(FileNames),relpath,(void*)&m_MakeDir); } +/////////////////////////////////////////////////////////////////////////////// +static string realpath(const string &FileName,void *pvDir) +{ + const fileinfo *pDir=*(const fileinfo **)pvDir; + const fileinfo *pPath=GetFileInfo(FileName,pDir); + if (pPath->Exists()) + return pPath->GetQuotedFullFileName(); + else + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// Make a path name relative to the current directory +string mhmakefileparser::f_realpath(const string & FileNames) const +{ + return IterList(ExpandExpression(FileNames),realpath,(void*)&m_MakeDir); +} + /////////////////////////////////////////////////////////////////////////////// static string makeupper(const string &FileName,void *) { -- cgit v1.2.3