mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-03-20 09:29:26 +08:00
Cherry-pick 375346e
This commit is contained in:
@@ -112,7 +112,7 @@ private:
|
||||
// needs to have dll-interface to be used by clients of class 'ON_Lock'
|
||||
// m_lock_value is private and all code that manages m_lock_value is explicitly implemented in the DLL.
|
||||
private:
|
||||
#if defined(ON_COMPILER_CLANG)
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU)
|
||||
std::atomic<int> m_lock_value;
|
||||
#else
|
||||
std::atomic<int> m_lock_value = ON_Lock::UnlockedValue;
|
||||
|
||||
@@ -948,7 +948,7 @@ int ON_VARGS_FUNC_CDECL ON_wString::FormatIntoBuffer(
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if defined(ON_COMPILER_CLANG)
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU)
|
||||
|
||||
static const wchar_t* ConvertToCLangFormat(
|
||||
const wchar_t* format,
|
||||
@@ -1057,7 +1057,7 @@ int ON_wString::FormatVargsIntoBuffer(
|
||||
if ( nullptr == format || 0 == format[0] )
|
||||
return 0;
|
||||
|
||||
#if defined(ON_COMPILER_CLANG)
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU)
|
||||
// CLang requires %ls to properly format a const wchar_t* parameter
|
||||
wchar_t clang_format_stack_buffer[128];
|
||||
ON_wStringBuffer clang_format_buffer(clang_format_stack_buffer, sizeof(clang_format_stack_buffer) / sizeof(clang_format_stack_buffer[0]));
|
||||
@@ -1126,7 +1126,7 @@ int ON_wString::FormatVargsOutputCount(
|
||||
if ( nullptr == format || 0 == format[0] )
|
||||
return 0;
|
||||
|
||||
#if defined(ON_COMPILER_CLANG)
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU)
|
||||
// Unlike _vscwprintf_p_l(), CLang's vswprintf() does not tell you how many characters would have
|
||||
// been written if there was space enough in the buffer.
|
||||
// It reports an error when there is not enough space.
|
||||
|
||||
@@ -148,7 +148,7 @@ int ON_wString::ScanBufferVargs(
|
||||
va_list args
|
||||
)
|
||||
{
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX)
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU)
|
||||
#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX)
|
||||
if (nullptr == buffer || nullptr == format)
|
||||
return -1;
|
||||
@@ -397,7 +397,7 @@ const char* ON_String::ToNumber(
|
||||
local_buffer[local_buffer_count++] = 0;
|
||||
|
||||
double x = value_on_failure;
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX)
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU)
|
||||
#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX)
|
||||
if (1 == sscanf(local_buffer, "%lg", &x))
|
||||
{
|
||||
@@ -639,7 +639,7 @@ const wchar_t* ON_wString::ToNumber(
|
||||
local_buffer[local_buffer_count++] = 0;
|
||||
|
||||
double x = value_on_failure;
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX)
|
||||
#if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU)
|
||||
#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX)
|
||||
if (1 == sscanf(local_buffer, "%lg", &x))
|
||||
{
|
||||
|
||||
@@ -177,7 +177,7 @@ bool ON_CreateUuid( ON_UUID& new_uuid )
|
||||
// identifies the user and some
|
||||
// customers may object.
|
||||
return true;
|
||||
#elif defined(ON_COMPILER_CLANG)
|
||||
#elif defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU)
|
||||
// Header: #include <uuid/uuid.h>
|
||||
if ( ON::endian::little_endian == ON::Endian() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user