Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #43 from mloskot/master
For Visual C++, defined std::strtoll in terms of _strtoi64()
  • Loading branch information
mloskot committed Feb 3, 2013
2 parents 1dc7048 + 6883da2 commit 8b5ce91
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/soci-platform.h
Expand Up @@ -10,6 +10,7 @@

// Portability hacks for Microsoft Visual C++ compiler
#ifdef _MSC_VER
#include <stdlib.h>

// Define if you have the vsnprintf variants.
#if _MSC_VER < 1500
Expand All @@ -24,12 +25,16 @@
// Define if you have the strtoll variants.
#if _MSC_VER >= 1300
# define HAVE_STRTOLL 1
# define strtoll(nptr, endptr, base) _strtoi64(nptr, endptr, base)
namespace std {
inline long long strtoll(char const* str, char** str_end, int base)
{
return _strtoi64(str, str_end, base);
}
}
#else
# undef HAVE_STRTOLL
# error "Visual C++ versions prior 1300 don't support strtoi64"
#endif // _MSC_VER >= 1300

#endif // _MSC_VER

#endif // SOCI_PLATFORM_H_INCLUDED

0 comments on commit 8b5ce91

Please sign in to comment.