diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-12-08 17:48:03 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-12-08 17:48:03 -0300 |
commit | c650d4e19c1f1fffc2f798db3d18a1ad1a58ab8b (patch) | |
tree | 4b9280503112055e2431344547001db59702e69c /core/ustring.cpp | |
parent | 09ff4571859b012b64876883e186bb7dfaca0c8c (diff) | |
parent | e176bb6a7c736e8f2fe7fb96f2a4ecbb296dced0 (diff) |
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r-- | core/ustring.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index f3c89a7908..bf2494e9b5 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -897,17 +897,8 @@ String String::num(double p_num,int p_decimals) { } char buf[256]; -#if defined(__GNUC__) -#ifdef MINGW_ENABLED - //snprintf is inexplicably broken in mingw - //sprintf(buf,fmt,p_num); - _snprintf(buf,256,fmt,p_num); -#else +#if defined(__GNUC__) || defined(_MSC_VER) snprintf(buf,256,fmt,p_num); -#endif - -#elif defined(_MSC_VER) - _snprintf(buf,256,fmt,p_num); #else sprintf(buf,fmt,p_num); #endif @@ -1178,10 +1169,7 @@ String String::num_scientific(double p_num) { char buf[256]; -#if defined(_MSC_VER) || defined(MINGW_ENABLED) - - _snprintf(buf,256,"%lg",p_num); -#elif defined(__GNUC__) +#if defined(__GNUC__) || defined(_MSC_VER) snprintf(buf,256,"%lg",p_num); #else sprintf(buf,"%.16lg",p_num); @@ -3096,7 +3084,11 @@ String String::http_escape() const { res += ord; } else { char h_Val[3]; - snprintf(h_Val, 3, "%.2X", ord); +#if defined(__GNUC__) || defined(_MSC_VER) + snprintf(h_Val, 3, "%.2X", ord); +#else + sprintf(h_Val, "%.2X", ord); +#endif res += "%"; res += h_Val; } |