Updated bspf.hxx for Windows build.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3303 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2016-04-03 00:24:24 +00:00
parent eb56efc3d5
commit 91e3afb3bb
2 changed files with 9 additions and 17 deletions

View File

@ -22,7 +22,7 @@
#include <cstdlib>
#define STELLA_VERSION "4.7.2"
#define STELLA_VERSION "4.8_pre"
#define STELLA_BUILD atoi("$Rev$" + 6)
#endif

View File

@ -93,24 +93,16 @@ namespace BSPF
static const string ARCH = "NOARCH";
#endif
// I wish Windows had a complete POSIX layer
#if defined BSPF_WINDOWS && !defined __GNUG__
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#else
#define HAVE_UNISTD_H // needed for building zlib
#include <strings.h>
using std::snprintf;
using std::vsnprintf;
#endif
//////////////////////////////////////////////////////////////////////
// Some convenience functions
template<typename T> inline void swap(T& a, T& b) { std::swap(a, b); }
template<typename T> inline T abs (T x) { return (x>=0) ? x : -x; }
template<typename T> inline T min (T a, T b) { return (a<b) ? a : b; }
template<typename T> inline T max (T a, T b) { return (a>b) ? a : b; }
template<typename T> inline T clamp (T a, T l, T u) { return (a<l) ? l : (a>u) ? u : a; }
template<typename T> inline T clamp(T a, T l, T u) { return (a<l) ? l : (a>u) ? u : a; }
using std::swap;
using std::min;
using std::max;
using std::abs;
using std::snprintf;
using std::vsnprintf;
// Compare two strings, ignoring case
inline int compareIgnoreCase(const string& s1, const string& s2)