Cross-Platform build scripts for audio plugins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.0KB

  1. diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp
  2. index a18d4f4..83562ab 100644
  3. --- a/src/common/filefn.cpp
  4. +++ b/src/common/filefn.cpp
  5. @@ -1138,14 +1138,15 @@ wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite)
  6. // For explanation, see: (warning...based mostly on observed behavior)
  7. // http://bugzilla.audacityteam.org/show_bug.cgi?id=1266
  8. // https://github.com/audacity/audacity/pull/94
  9. - unsigned long doserrno = 0;
  10. for (int i = 0; i < 2000; i++)
  11. {
  12. if ( wxRename (file1, file2) == 0 )
  13. return true;
  14. - unsigned long doserrno;
  15. - _get_doserrno(&doserrno);
  16. - if (doserrno != ERROR_ACCESS_DENIED && (doserrno != ERROR_ALREADY_EXISTS || exists))
  17. + // https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/get-doserrno?view=msvc-160
  18. + // We recommend _get_errno instead of _get_doserrno for portable error codes
  19. + int wxerrno;
  20. + _get_errno(&wxerrno);
  21. + if (wxerrno != EACCES && (wxerrno != EEXIST || exists))
  22. break;
  23. wxMilliSleep(1);
  24. }