[Spice-devel] [vdagent-win PATCH V3 04/11] vdcommon.h: add comment about OLDMSVCRT

Uri Lublin uril at redhat.com
Tue Dec 30 08:20:50 PST 2014


---
 common/vdcommon.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/common/vdcommon.h b/common/vdcommon.h
index 177721c..3d0f794 100644
--- a/common/vdcommon.h
+++ b/common/vdcommon.h
@@ -43,6 +43,23 @@ typedef CRITICAL_SECTION mutex_t;
 #define ALIGN_VC __declspec (align(1))
 #endif
 
+/*
+ * Note: OLDMSVCRT, which is defined (in the Makefile) for mingw builds, and
+ * is not defined for Visual Studio builds.
+ *
+ * On Windows XP some those functions are missing from the msvcrt.dll
+ * When compiled with mingw, the program fails to run due to missing functions.
+ * One can link to a newer runtime dll, e.g. msvcr100.dll, but that would
+ * require installing that DLL on the guest. That can be done by downloading
+ * and installing Microsoft Visual C++ 2010 Redistributable Package.
+ * (same for 110.dll and 2012 Redistributable Package, etc).
+ *
+ * Since we do not want to add this dependency, we use functions that are
+ * available in msvcrt.dll (and use define in the code).
+ *
+ * Currently Visual Studio builds are built with /MT (static mode) such that
+ * those functions are not required to be in that dll on the guest.
+ */
 #ifdef OLDMSVCRT
 #define swprintf_s(buf, sz, format...) swprintf(buf, format)
 #endif
-- 
1.7.1



More information about the Spice-devel mailing list