pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

coreclr-git: Add patches for _vsnprintf()



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Fri Feb 19 22:01:46 2016 +0100
Changeset:	ab434eacdde5fc2b14fb3e254fd7d7158a8943cd

Added Files:
	coreclr-git/patches/patch-src_pal_inc_pal.h
	coreclr-git/patches/patch-src_pal_src_cruntime_printf.cpp
	coreclr-git/patches/patch-src_pal_src_cruntime_printfcpp.cpp
	coreclr-git/patches/patch-src_pal_src_cruntime_silent__printf.cpp

Log Message:
coreclr-git: Add patches for _vsnprintf()

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ab434eacdde5fc2b14fb3e254fd7d7158a8943cd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 coreclr-git/patches/patch-src_pal_inc_pal.h        | 12 +++
 .../patches/patch-src_pal_src_cruntime_printf.cpp  | 89 ++++++++++++++++++++++
 .../patch-src_pal_src_cruntime_printfcpp.cpp       | 24 ++++++
 .../patch-src_pal_src_cruntime_silent__printf.cpp  | 26 +++++++
 4 files changed, 151 insertions(+)

diffs:
diff --git a/coreclr-git/patches/patch-src_pal_inc_pal.h b/coreclr-git/patches/patch-src_pal_inc_pal.h
new file mode 100644
index 0000000..96477cf
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_inc_pal.h
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- src/pal/inc/pal.h.orig	2016-02-18 21:11:19.000000000 +0000
++++ src/pal/inc/pal.h
+@@ -6050,6 +6050,7 @@ CoCreateGuid(OUT GUID * pguid);
+ #define _close        PAL__close
+ #define _wcstoui64    PAL__wcstoui64
+ #define _flushall     PAL__flushall
++#define _vsnprintf    PAL__vsnprintf
+ 
+ #ifdef _AMD64_ 
+ #define _mm_getcsr    PAL__mm_getcsr
diff --git a/coreclr-git/patches/patch-src_pal_src_cruntime_printf.cpp b/coreclr-git/patches/patch-src_pal_src_cruntime_printf.cpp
new file mode 100644
index 0000000..cc81d6a
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_cruntime_printf.cpp
@@ -0,0 +1,89 @@
+$NetBSD$
+
+--- src/pal/src/cruntime/printf.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/pal/src/cruntime/printf.cpp
+@@ -45,6 +45,7 @@ static int SscanfFloatCheckExponent(LPCS
+                                       void * voidPtr, int * pn);
+ #endif // SSCANF_CANNOT_HANDLE_MISSING_EXPONENT
+ 
++
+ /*******************************************************************************
+ Function:
+   Internal_AddPaddingA
+@@ -295,7 +296,7 @@ wsprintfA(
+     ENTRY("wsprintfA (buffer=%p, format=%p (%s))\n", buffer, format, format);
+ 
+     va_start(ap, format);
+-    Length = PAL__vsnprintf(buffer, 1024, format, ap);
++    Length = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), buffer, 1024, format, ap);
+     va_end(ap);
+ 
+     LOGEXIT("wsprintfA returns int %d\n", Length);
+@@ -354,7 +355,7 @@ _snprintf(
+           buffer, (unsigned long) count, format, format);
+ 
+     va_start(ap, format);
+-    Length = PAL__vsnprintf(buffer, count, format, ap);
++    Length = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), buffer, count, format, ap);
+     va_end(ap);
+ 
+     LOGEXIT("_snprintf returns int %d\n", Length);
+@@ -1529,7 +1530,7 @@ PAL_sprintf(
+     ENTRY("PAL_sprintf (buffer=%p, format=%p (%s))\n", buffer, format, format);
+ 
+     va_start(ap, format);
+-    Length = PAL__vsnprintf(buffer, 0x7fffffff, format, ap);
++    Length = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), buffer, 0x7fffffff, format, ap);
+     va_end(ap);
+ 
+     LOGEXIT("PAL_sprintf returns int %d\n", Length);
+@@ -1613,7 +1614,7 @@ PAL_vsprintf(char *buffer, 
+     ENTRY("PAL_vsprintf (buffer=%p, format=%p (%s), argptr=%p)\n", 
+           buffer, format, format, argptr);
+ 
+-    Length = PAL__vsnprintf(buffer, 0x7fffffff, format, argptr);
++    Length = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), buffer, 0x7fffffff, format, argptr);
+ 
+     LOGEXIT("PAL_vsprintf returns int %d\n", Length);
+     PERF_EXIT(vsprintf);
+@@ -1624,35 +1625,6 @@ PAL_vsprintf(char *buffer, 
+ 
+ /*++
+ Function:
+-  _vsnprintf
+-
+-See MSDN doc.
+---*/
+-int 
+-__cdecl 
+-_vsnprintf(char *buffer, 
+-           size_t count, 
+-           const char *format, 
+-           va_list argptr)
+-{
+-    LONG Length;
+-
+-    PERF_ENTRY(_vsnprintf);
+-    ENTRY("_vsnprintf (buffer=%p, count=%d, format=%p (%s), argptr=%p)\n", 
+-          buffer, count, format, format, argptr);
+-
+-    Length = PAL__vsnprintf(buffer, count, format, argptr);
+-
+-    LOGEXIT("_vsnprintf returns int %d\n", Length);
+-    PERF_EXIT(_vsnprintf);
+-
+-    return Length;
+-}
+-
+-
+-
+-/*++
+-Function:
+   PAL_vswprintf
+ 
+ See MSDN doc.
+@@ -1785,4 +1757,3 @@ static int SscanfFloatCheckExponent(LPCS
+     return ret;
+ }
+ #endif // SSCANF_CANNOT_HANDLE_MISSING_EXPONENT
+-
diff --git a/coreclr-git/patches/patch-src_pal_src_cruntime_printfcpp.cpp b/coreclr-git/patches/patch-src_pal_src_cruntime_printfcpp.cpp
new file mode 100644
index 0000000..778d80e
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_cruntime_printfcpp.cpp
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- src/pal/src/cruntime/printfcpp.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/pal/src/cruntime/printfcpp.cpp
+@@ -1068,7 +1068,18 @@ Parameters:
+ 
+ int __cdecl PAL__vsnprintf(LPSTR Buffer, size_t Count, LPCSTR Format, va_list ap)
+ {
+-    return CoreVsnprintf(InternalGetCurrentThread(), Buffer, Count, Format, ap);
++    LONG Length;
++
++    PERF_ENTRY(PAL__vsnprintf);
++    ENTRY("PAL__vsnprintf (buffer=%p, count=%d, format=%p (%s), argptr=%p)\n",
++          Buffer, Count, Format, Format, ap);
++
++    Length = CoreVsnprintf(InternalGetCurrentThread(), Buffer, Count, Format, ap);
++
++    LOGEXIT("PAL__vsnprintf returns int %d\n", Length);
++    PERF_EXIT(PAL__vsnprintf);
++
++    return Length;
+ }
+ 
+ /*******************************************************************************
diff --git a/coreclr-git/patches/patch-src_pal_src_cruntime_silent__printf.cpp b/coreclr-git/patches/patch-src_pal_src_cruntime_silent__printf.cpp
new file mode 100644
index 0000000..f028963
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_cruntime_silent__printf.cpp
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- src/pal/src/cruntime/silent_printf.cpp.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/pal/src/cruntime/silent_printf.cpp
+@@ -26,6 +26,7 @@ Revision History:
+ #include "pal/cruntime.h"
+ #include "pal/locale.h"
+ #include "pal/printfcpp.hpp"
++#include "pal/thread.hpp"
+ 
+ /* clip strings (%s, %S) at this number of characters */
+ #define MAX_STR_LEN 300
+@@ -280,7 +281,7 @@ INT Silent_PAL_vsnprintf(LPSTR Buffer, I
+                     }                                     
+                     va_list apcopy;
+                     va_copy(apcopy, ap);
+-                    TempInt = PAL__vsnprintf(BufferPtr, TempCount, TempBuff, apcopy);
++                    TempInt = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), BufferPtr, TempCount, TempBuff, apcopy);
+                     va_end(apcopy);
+                     PAL_printf_arg_remover(&ap, Width, Precision, Type, Prefix);
+                 }
+@@ -987,4 +988,3 @@ size_t Silent_PAL_wcslen(const wchar_16 
+     
+     return nChar;
+ }
+-


Home | Main Index | Thread Index | Old Index