In order to detect that sort of problem, here's a bit of code that replaces the SCAN_VAR macro; insert it into state.h replacing the #define SCAN_VAR line:
#if !defined(__cplusplus) || ((_MSC_VER < 1900) && (__cplusplus <= 199711L))
#define SCAN_VAR(x) ScanVar(&x, sizeof(x), #x)
#else
class scan_exception
{
const char* const _what_arg;
public:
const char* const variable;
scan_exception(const char* const what_arg, const char* const variable) : _what_arg(what_arg)
, variable(variable)
{
return;
}
const char* const what()
{
return _what_arg;
}
};
#define SCAN_VAR(x) { if (std::is_pointer<decltype(x)>::value) throw scan_exception("variable is a pointer!", #x); else ScanVar(&x, sizeof(x), #x); }
#endif
Also insert #include <type_traits> in burnint.h:
#if defined(__cplusplus) && !((_MSC_VER < 1900) && (__cplusplus <= 199711L))
#define _USE_MATH_DEFINES
#include <type_traits>
#endif
If you use this, trying to include a pointer in a savestate will cause an exception to be thrown. Note that it's only compiled if your compiler has C++11 support enabled, does not work for code that's compiled as plain C, and your compiler may complain about exceptions being thrown where it doesn't expect them.
Other than that, see screenshot.