Can build for windows without precompiled headers...

... Requires some more wx header inclusions, a renaming of CopyFile (to avoid
colliding with a certain macro changing it to CopyFileW), and an explicit
deletion of a copy constructor and assignment (to avoid generation of
std::vector members for an incomplete type)
This commit is contained in:
Paul Licameli 2020-05-26 16:20:10 -04:00
parent 5f5a477dbf
commit 4ff0a9d74e
12 changed files with 20 additions and 7 deletions

View File

@ -1097,7 +1097,7 @@ void MacroCommands::MigrateLegacyChains()
newDir.SetFullName(name);
const auto newPath = newDir.GetFullPath();
if (!wxFileExists(newPath))
FileNames::CopyFile(file, newPath);
FileNames::DoCopyFile(file, newPath);
}
done = true;
}

View File

@ -12,6 +12,10 @@
#if defined(EXPERIMENTAL_CRASH_REPORT)
#if defined(__WXMSW__)
#include <wx/evtloop.h>
#endif
#include "wxFileNameWrapper.h"
#include "AudacityLogger.h"
#include "AudioIOBase.h"

View File

@ -1283,7 +1283,7 @@ BlockFilePtr DirManager::CopyBlockFile(const BlockFilePtr &b)
//a summary file, so we should check before we copy.
if(b->IsSummaryAvailable())
{
if( !FileNames::CopyFile(fn.GetFullPath(),
if( !FileNames::DoCopyFile(fn.GetFullPath(),
newFile.GetFullPath()) )
// Disk space exhaustion, maybe
throw FileException{
@ -1423,7 +1423,7 @@ std::pair<bool, FilePath> DirManager::LinkOrCopyToNewProjectDirectory(
success = FileNames::HardLinkFile( oldPath, newPath );
if (!success)
link = false,
success = FileNames::CopyFile( oldPath, newPath );
success = FileNames::DoCopyFile( oldPath, newPath );
if (!success)
return { false, {} };
}
@ -1454,7 +1454,7 @@ std::pair<bool, FilePath> DirManager::LinkOrCopyToNewProjectDirectory(
//if it doesn't, we can assume it was written to the NEW name, which is fine.
if (oldFileName.FileExists())
{
bool ok = FileNames::CopyFile(oldPath, newPath);
bool ok = FileNames::DoCopyFile(oldPath, newPath);
if (!ok)
return { false, {} };
}

View File

@ -145,7 +145,7 @@ wxString FileNames::FormatWildcard( const FileTypes &fileTypes )
}
}
bool FileNames::CopyFile(
bool FileNames::DoCopyFile(
const FilePath& file1, const FilePath& file2, bool overwrite)
{
#ifdef __WXMSW__

View File

@ -55,7 +55,7 @@ namespace FileNames
wxString FormatWildcard( const FileTypes &fileTypes );
// This exists to compensate for bugs in wxCopyFile:
bool CopyFile(
bool DoCopyFile(
const FilePath& file1, const FilePath& file2, bool overwrite = true);
// wxWidgets doesn't have a function to do this: make a hard file-system

View File

@ -1859,7 +1859,7 @@ bool PluginManager::DropFile(const wxString &fileName)
auto dstPath = dst.GetFullPath();
if ( src.FileExists() )
// A simple one-file plug-in
copied = FileNames::CopyFile(
copied = FileNames::DoCopyFile(
src.GetFullPath(), dstPath, true );
else {
// A sub-folder

View File

@ -17,6 +17,7 @@
#include <memory>
#include <wx/weakref.h> // member variable
#include <wx/window.h> // MSVC wants this
class wxFrame;
class wxWindow;

View File

@ -97,6 +97,8 @@ class AUDACITY_DLL_API ThemeBase /* not final */
{
public:
ThemeBase(void);
ThemeBase ( const ThemeBase & ) = delete;
ThemeBase &operator =( const ThemeBase & ) = delete;
public:
virtual ~ThemeBase(void);

View File

@ -16,6 +16,8 @@
#include "../Experimental.h"
#include <wx/bitmap.h> // member variables
#if defined(EXPERIMENTAL_EFFECTS_RACK)
#include <vector>

View File

@ -44,6 +44,7 @@
#include <wx/window.h>
#include <wx/log.h>
#include <wx/intl.h>
#include <wx/stream.h>
#include "Export.h"
#include "../FileIO.h"

View File

@ -23,6 +23,7 @@
#include <wx/log.h>
#include <wx/slider.h>
#include <wx/stream.h>
#include <vorbis/vorbisenc.h>

View File

@ -27,6 +27,8 @@ class AUDACITY_DLL_API FileHistory
public:
FileHistory(size_t maxfiles = 12, wxWindowID idbase = wxID_FILE);
virtual ~FileHistory();
FileHistory( const FileHistory& ) = delete;
FileHistory &operator =( const FileHistory & ) = delete;
// These constants define the range of IDs reserved by the global file history
enum {