Skip to content

Commit

Permalink
Revert "Fix CopyFile/FileCopy discrepancy between [Code] and ISPP.", …
Browse files Browse the repository at this point in the history
…except for the improved description. It's actually [Code]'s FileCopy which should be renamed instead of ISPP's CopyFile.
  • Loading branch information
martijnlaan committed Aug 14, 2024
1 parent b8cb295 commit 445223b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
10 changes: 3 additions & 7 deletions Files/ISPPBuiltins.iss
Original file line number Diff line number Diff line change
Expand Up @@ -302,21 +302,17 @@
#define SameStr(str S1, str S2) \
S1 == S2

#define WarnRenamed(str OldName, str NewName) \
#define WarnRenamedVersion(str OldName, str NewName) \
Warning("Function """ + OldName + """ has been renamed. Use """ + NewName + """ instead.")

#define ParseVersion(str FileName, *Major, *Minor, *Rev, *Build) \
WarnRenamed("ParseVersion", "GetVersionComponents"), \
WarnRenamedVersion("ParseVersion", "GetVersionComponents"), \
GetVersionComponents(FileName, Major, Minor, Rev, Build)

#define GetFileVersion(str FileName) \
WarnRenamed("GetFileVersion", "GetVersionNumbersString"), \
WarnRenamedVersion("GetFileVersion", "GetVersionNumbersString"), \
GetVersionNumbersString(FileName)

#define CopyFile(str ExistingFile, str NewFile) \
WarnRenamed("CopyFile", "FileCopy"), \
FileCopy(ExistingFile, NewFile)

#ifdef DisablePOptP
# pragma parseroption -p-
#endif
Expand Down
6 changes: 3 additions & 3 deletions ISHelp/ispp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1000,10 +1000,10 @@ The first group of options (<tt>option</tt>) controls the general options, while
<p>Deletes the specified file. Does not return anything. Also see <tt><link href="DeleteFile">DeleteFile</link></tt>.</p>
</description>
</topic>
<topic id="FileCopy">
<title>FileCopy</title>
<topic id="CopyFile">
<title>CopyFile</title>
<section title="Prototype">
<pre><line><b>void</b> FileCopy(<b>str</b> ExistingFile, <b>str</b> NewFile)</line></pre>
<pre><line><b>void</b> CopyFile(<b>str</b> ExistingFile, <b>str</b> NewFile)</line></pre>
</section>
<description>
<p>Copies ExistingFile to NewFile, preserving time stamp and file attributes. If NewFile already exists, it will be overwritten.</p>
Expand Down
4 changes: 2 additions & 2 deletions Projects/Src/ISPP.Funcs.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ function DelFileNowFunc(Ext: Longint; const Params: IIsppFuncParams;
end;
end;

function FileCopyFunc(Ext: Longint; const Params: IIsppFuncParams;
function CopyFileFunc(Ext: Longint; const Params: IIsppFuncParams;
const FuncResult: IIsppFuncResult): TIsppFuncResult; stdcall;
begin
if CheckParams(Params, [evStr, evStr], 2, Result) then
Expand Down Expand Up @@ -2045,7 +2045,7 @@ procedure RegisterFunctions(Preproc: TPreprocessor);
RegisterFunction('GetEnv', GetEnvFunc, -1);
RegisterFunction('DeleteFile', DelFileFunc, -1);
RegisterFunction('DeleteFileNow', DelFileNowFunc, -1);
RegisterFunction('FileCopy', FileCopyFunc, -1);
RegisterFunction('CopyFile', CopyFileFunc, -1);
RegisterFunction('ReadEnv', GetEnvFunc, -1);
RegisterFunction('FindFirst', FindFirstFunc, -1);
RegisterFunction('FindNext', FindNextFunc, -1);
Expand Down
6 changes: 1 addition & 5 deletions whatsnew.htm
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@
<li>Documented support functions <tt>VarArrayGet</tt> and <tt>VarArraySet</tt> which were already available but not documented.</li>
</ul>
</li>
<li>ISPP changes:
<ul>
<li>Added support functions <tt>GetSHA256OfFile</tt>, <tt>GetSHA256OfString</tt>, and <tt>GetSHA256OfUnicodeString</tt>.</li>
<li>Support function <tt>CopyFile</tt> has been renamed to <tt>FileCopy</tt>. The old name is still supported, but it is recommended to update your scripts to the new name and the compiler will issue a warning if you don't.</li>
</ul>
<li>ISPP change: Added support functions <tt>GetSHA256OfFile</tt>, <tt>GetSHA256OfString</tt>, and <tt>GetSHA256OfUnicodeString</tt>.</li>
<li>Various tweaks and other documentation improvements.</li>
</ul>

Expand Down

0 comments on commit 445223b

Please sign in to comment.