mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-12 19:31:47 +00:00
Again with this non-conformance stupidity!
This commit is contained in:
parent
289637384d
commit
87989a5f09
@ -2,9 +2,17 @@
|
|||||||
#define __TRACYPRINT_HPP__
|
#define __TRACYPRINT_HPP__
|
||||||
|
|
||||||
#if ( defined _MSC_VER && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L
|
#if ( defined _MSC_VER && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L
|
||||||
# include <charconv>
|
# if __has_include(<charconv>) && __has_include(<type_traits>)
|
||||||
# include <type_traits>
|
# include <charconv>
|
||||||
|
# include <type_traits>
|
||||||
|
# else
|
||||||
|
# define NO_CHARCONV
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
|
# define NO_CHARCONV
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NO_CHARCONV
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -63,7 +71,7 @@ static tracy_force_inline void RealToStringInteger( char* buf, char* end )
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
static inline char* PrintFloat( char* begin, char* end, T value, int precision )
|
static inline char* PrintFloat( char* begin, char* end, T value, int precision )
|
||||||
{
|
{
|
||||||
#if ( defined _MSC_VER && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L
|
#ifndef NO_CHARCONV
|
||||||
return std::to_chars( begin, end, value, std::chars_format::fixed, precision ).ptr;
|
return std::to_chars( begin, end, value, std::chars_format::fixed, precision ).ptr;
|
||||||
#else
|
#else
|
||||||
return begin + sprintf( begin, "%.*f", precision, value );
|
return begin + sprintf( begin, "%.*f", precision, value );
|
||||||
@ -73,14 +81,14 @@ static inline char* PrintFloat( char* begin, char* end, T value, int precision )
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
static inline char* PrintFloat( char* begin, char* end, T value )
|
static inline char* PrintFloat( char* begin, char* end, T value )
|
||||||
{
|
{
|
||||||
#if ( defined _MSC_VER && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L
|
#ifndef NO_CHARCONV
|
||||||
return std::to_chars( begin, end, value, std::chars_format::fixed ).ptr;
|
return std::to_chars( begin, end, value, std::chars_format::fixed ).ptr;
|
||||||
#else
|
#else
|
||||||
return begin + sprintf( begin, "%f", value );
|
return begin + sprintf( begin, "%f", value );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ( defined _MSC_VER && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L
|
#ifndef NO_CHARCONV
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static inline const char* RealToString( T val )
|
static inline const char* RealToString( T val )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user