Fix all sort of Windows stupidities

- Using _export as method name is no-no on certain bad OS
- Don't re-declare certain defines involved in brain-dead linking
  shit
- Actually build crandom::arch_get_tsc/arch_get_random on Win32
This commit is contained in:
Ilari Liusvaara 2014-05-19 13:35:33 +03:00
parent 7f586e55b6
commit f2de04266e
5 changed files with 16 additions and 10 deletions

View file

@ -16,8 +16,9 @@ struct movie_branches
void rename(const std::string& oldn, const std::string& newn);
void _delete(const std::string& branch);
std::set<std::string> _movie_branches(const std::string& filename);
void import(const std::string& filename, const std::string& ibranch, const std::string& branchname, int mode);
void _export(const std::string& filename, const std::string& branchname, bool binary);
void import_branch(const std::string& filename, const std::string& ibranch, const std::string& branchname,
int mode);
void export_branch(const std::string& filename, const std::string& branchname, bool binary);
private:
movie_logic& mlogic;
};

View file

@ -99,8 +99,8 @@ std::set<std::string> movie_branches::_movie_branches(const std::string& filenam
return e.enumerate();
}
void movie_branches::import(const std::string& filename, const std::string& ibranch, const std::string& branchname,
int mode)
void movie_branches::import_branch(const std::string& filename, const std::string& ibranch,
const std::string& branchname, int mode)
{
auto& mv = mlogic.get_mfile();
if(mv.branches.count(branchname) && &mv.branches[branchname] == mv.input)
@ -151,7 +151,7 @@ void movie_branches::import(const std::string& filename, const std::string& ibra
}
}
void movie_branches::_export(const std::string& filename, const std::string& branchname, bool binary)
void movie_branches::export_branch(const std::string& filename, const std::string& branchname, bool binary)
{
auto& mv = mlogic.get_mfile();
if(!mv.branches.count(branchname))

View file

@ -71,7 +71,12 @@ void generate(void* buffer, size_t buffersize)
if(r > 0) out += r;
}
}
}
#endif
namespace crandom
{
uint64_t arch_get_tsc()
{
#ifdef ARCH_IS_I386
@ -94,6 +99,4 @@ uint64_t arch_get_random()
return 0;
#endif
}
}
#endif
}

View file

@ -1,4 +1,6 @@
#ifndef CURL_STATICLIB
#define CURL_STATICLIB
#endif
#include <cstdio>
#include "httpreq.hpp"
#include "httpauth.hpp"

View file

@ -1700,7 +1700,7 @@ void wxeditor_movie::_moviepanel::on_popup_menu(wxCommandEvent& e)
dbranch = pick_text(this, "Enter new branch name", "Enter name for an imported branch:",
branch, false);
lsnes_instance.run_async([this, filename, branch, dbranch, mode]() {
lsnes_instance.mbranch.import(filename, branch, dbranch, mode);
lsnes_instance.mbranch.import_branch(filename, branch, dbranch, mode);
}, [this](std::exception& e) {
show_exception(this, "Can't import branch", "", e);
});
@ -1717,7 +1717,7 @@ void wxeditor_movie::_moviepanel::on_popup_menu(wxCommandEvent& e)
mode = g.second;
lsnes_instance.run_async([this, file, mode]() {
std::string bname = lsnes_instance.mbranch.get();
lsnes_instance.mbranch._export(file, bname, mode == MBRANCH_IMPORT_BINARY);
lsnes_instance.mbranch.export_branch(file, bname, mode == MBRANCH_IMPORT_BINARY);
}, [this](std::exception& e) {
show_exception(this, "Can't export branch", "", e);
});