change std::snprintf to snprintf for android compile

This commit is contained in:
xujh 2016-09-01 12:02:41 +08:00
parent 94f661bf3c
commit 6791d6ebf2
2 changed files with 97 additions and 97 deletions

View File

@ -9795,11 +9795,11 @@ namespace sol {
// std::to_string doesn't exist in android still, with NDK, so this bullshit // std::to_string doesn't exist in android still, with NDK, so this bullshit
// is necessary // is necessary
// thanks, Android :v // thanks, Android :v
int appended = std::snprintf(nullptr, 0, "%d", uniqueness); int appended = snprintf(nullptr, 0, "%d", uniqueness);
std::size_t insertionpoint = uniquegcmetakey.length() - 1; std::size_t insertionpoint = uniquegcmetakey.length() - 1;
uniquegcmetakey.append(appended, '\0'); uniquegcmetakey.append(appended, '\0');
char* uniquetarget = &uniquegcmetakey[insertionpoint]; char* uniquetarget = &uniquegcmetakey[insertionpoint];
std::snprintf(uniquetarget, uniquegcmetakey.length(), "%d", uniqueness); snprintf(uniquetarget, uniquegcmetakey.length(), "%d", uniqueness);
++uniqueness; ++uniqueness;
const char* gcmetakey = &usertype_traits<T>::gc_table[0]; const char* gcmetakey = &usertype_traits<T>::gc_table[0];

View File

@ -457,11 +457,11 @@ namespace sol {
// std::to_string doesn't exist in android still, with NDK, so this bullshit // std::to_string doesn't exist in android still, with NDK, so this bullshit
// is necessary // is necessary
// thanks, Android :v // thanks, Android :v
int appended = std::snprintf(nullptr, 0, "%d", uniqueness); int appended = snprintf(nullptr, 0, "%d", uniqueness);
std::size_t insertionpoint = uniquegcmetakey.length() - 1; std::size_t insertionpoint = uniquegcmetakey.length() - 1;
uniquegcmetakey.append(appended, '\0'); uniquegcmetakey.append(appended, '\0');
char* uniquetarget = &uniquegcmetakey[insertionpoint]; char* uniquetarget = &uniquegcmetakey[insertionpoint];
std::snprintf(uniquetarget, uniquegcmetakey.length(), "%d", uniqueness); snprintf(uniquetarget, uniquegcmetakey.length(), "%d", uniqueness);
++uniqueness; ++uniqueness;
const char* gcmetakey = &usertype_traits<T>::gc_table[0]; const char* gcmetakey = &usertype_traits<T>::gc_table[0];