jdk/src/share/bin/main.c
changeset 1776 33e9405ab91b
parent 715 f16baef3a20e
child 5381 d6d64a42ff51
--- a/jdk/src/share/bin/main.c	Wed Jul 05 16:44:40 2017 +0200
+++ b/jdk/src/share/bin/main.c	Wed Jan 14 21:35:03 2009 -0800
@@ -32,6 +32,43 @@
 
 #include "defines.h"
 
+#ifdef _MSC_VER
+#if _MSC_VER > 1400
+
+/*
+ * When building for Microsoft Windows, main has a dependency on msvcr??.dll.
+ *
+ * When using Visual Studio 2005 or later, that must be recorded in
+ * the [java,javaw].exe.manifest file.
+ *
+ * Reference:
+ *     C:/Program Files/Microsoft SDKs/Windows/v6.1/include/crtdefs.h
+ */
+#include <crtassem.h>
+#ifdef _M_IX86
+
+#pragma comment(linker,"/manifestdependency:\"type='win32' "            \
+        "name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' "              \
+        "version='" _CRT_ASSEMBLY_VERSION "' "                          \
+        "processorArchitecture='x86' "                                  \
+        "publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
+
+#endif /* _M_IX86 */
+
+//This may not be necessary yet for the Windows 64-bit build, but it
+//will be when that build environment is updated.  Need to test to see
+//if it is harmless:
+#ifdef _M_AMD64
+
+#pragma comment(linker,"/manifestdependency:\"type='win32' "            \
+        "name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' "              \
+        "version='" _CRT_ASSEMBLY_VERSION "' "                          \
+        "processorArchitecture='amd64' "                                \
+        "publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
+
+#endif  /* _M_AMD64 */
+#endif  /* _MSC_VER > 1400 */
+#endif  /* _MSC_VER */
 
 /*
  * Entry point.