]> OCCT Git - occt.git/commitdiff
0028089: Mesh - New algorithm for triangulation of 2d polygons
authoroan <oan@opencascade.com>
Mon, 16 Jan 2023 11:59:08 +0000 (14:59 +0300)
committeroan <oan@opencascade.com>
Mon, 16 Jan 2023 11:59:08 +0000 (14:59 +0300)
Added Vsprintf() wrapper for vsprintf() preserving C locale.

src/Standard/Standard_CString.cxx
src/Standard/Standard_CString.hxx

index dc0a2223a12a372d41cab48371bcb5b4ca8f050b..ac0a8f98cf9429c2c3a296418576a6a10e57a4cd 100755 (executable)
@@ -129,3 +129,9 @@ int Sprintf (char* theBuffer, const char* theFormat, ...)
   va_end(argp);
   return result;
 }
+
+int Vsprintf (char* theBuffer, const char* theFormat, va_list theArgList)
+{
+  SAVE_TL();
+  return vsprintf_l(theBuffer, Standard_CLocaleSentry::GetCLocale(), theFormat, theArgList);
+}
index f28414f0bd8169bd14d2f7d9a9bf31dbe5fe1c61..ea999b65e880280254ddd5ef247ed760cb556bb8 100644 (file)
@@ -51,6 +51,15 @@ __Standard_API int    Printf  (const char* theFormat, ...);
 __Standard_API int    Fprintf (FILE* theFile, const char* theFormat, ...);
 __Standard_API int    Sprintf (char* theBuffer, const char* theFormat, ...);
 
+//! Equivalent of standard C function vsprintf() that always uses C locale.
+//! Note that this function does not check buffer bounds and should be used with precaution measures
+//! (only with format fitting into the buffer of known size).
+//! @param theBuffer  [in] [out] string buffer to fill
+//! @param theFormat  [in] format to apply
+//! @param theArgList [in] argument list for specified format
+//! @return the total number of characters written, or a negative number on error
+Standard_EXPORT int Vsprintf (char* theBuffer, const char* theFormat, va_list theArgList);
+
 //============================================================================
 //==== IsEqual : Returns Standard_True if two booleans have the same value
 //============================================================================