diff --git a/src/Makefile b/src/Makefile index 816299b2..8a82a32c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -42,7 +42,6 @@ else ifeq ($(platform),win) link += -mwindows -mthreads # link += -mconsole -mthreads link += -s -luuid -lkernel32 -luser32 -lgdi32 -lshell32 - # statically link Qt for Windows build link += -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc ruby := video.direct3d video.wgl video.directdraw video.gdi video.qtraster @@ -206,6 +205,11 @@ install: install -D -m 644 data/bsnes.png $(DESTDIR)$(prefix)/share/pixmaps/bsnes.png install -D -m 644 data/bsnes.desktop $(DESTDIR)$(prefix)/share/applications/bsnes.desktop +uninstall: + rm $(DESTDIR)$(prefix)/bin/bsnes + rm $(DESTDIR)$(prefix)/share/pixmaps/bsnes.png + rm $(DESTDIR)$(prefix)/share/applications/bsnes.desktop + clean: ui_clean -@$(call delete,obj/*.o) -@$(call delete,*.res) @@ -214,18 +218,3 @@ clean: ui_clean -@$(call delete,*.ilk) -@$(call delete,*.pdb) -@$(call delete,*.manifest) - -help: - @echo "Usage: $(MAKE) platform=(os) compiler=(cc) [options]" - @echo "" - @echo "Supported platforms:" - @echo " x - Linux / BSD (x86, x86-64)" - @echo " win - Windows (x86, x86-64)" - @echo "" - @echo "Supported compilers:" - @echo " gcc - GCC compiler" - @echo " mingw32-gcc - MinGW compiler" - @echo " i586-mingw32-gcc - MinGW cross compiler" - @echo "" - @echo "Example: $(MAKE) platform=x compiler=gcc" - @echo "" diff --git a/src/base.hpp b/src/base.hpp index b9ef1f28..f59902cc 100644 --- a/src/base.hpp +++ b/src/base.hpp @@ -1,4 +1,4 @@ -static const char bsnesVersion[] = "062.09"; +static const char bsnesVersion[] = "062.10"; static const char bsnesTitle[] = "bsnes"; static const unsigned bsnesSerializerVersion = 8; diff --git a/src/lib/nall/function.hpp b/src/lib/nall/function.hpp index e5ad8bc4..3f0f704e 100644 --- a/src/lib/nall/function.hpp +++ b/src/lib/nall/function.hpp @@ -1,6 +1,9 @@ #ifndef NALL_FUNCTION_HPP #define NALL_FUNCTION_HPP +#include +#include + namespace nall { template class function; @@ -34,28 +37,29 @@ namespace nall { public: R operator()(P... p) const { return data.callback(data, p...); } operator bool() const { return data.callback; } - - void reset() { - data.callback = 0; - } + void reset() { data.callback = 0; } function& operator=(const function &source) { memcpy(&data, &source.data, sizeof(data_t)); return *this; } function(const function &source) { operator=(source); } + //no pointer function() { data.callback = 0; } + //symbolic link pointer (nall/dl.hpp::sym, etc) function(void *callback) { data.callback = callback ? &callback_global : 0; data.callback_global = (R (*)(P...))callback; } + //global function pointer function(R (*callback)(P...)) { data.callback = &callback_global; data.callback_global = callback; } + //member function pointer template function(R (C::*callback)(P...), C *object) { static_assert(sizeof data.callback_member >= sizeof callback, "callback_member is too small"); @@ -64,6 +68,7 @@ namespace nall { data.object = object; } + //const member function pointer template function(R (C::*callback)(P...) const, C *object) { static_assert(sizeof data.callback_member >= sizeof callback, "callback_member is too small"); @@ -71,12 +76,17 @@ namespace nall { (R (C::*&)(P...))data.callback_member = (R (C::*&)(P...))callback; data.object = object; } + + //lambda function pointer + template + function(T callback) { + static_assert(std::is_same::type>::value, "lambda mismatch"); + data.callback = &callback_global; + data.callback_global = (R (*)(P...))callback; + } }; - template - function bind(R (*callback)(P...)) { - return function(callback); - } + //bind functions to ease construction and assignment of function() with more than one argument template function bind(R (C::*callback)(P...), C *object) {