From 9f92c88f4379e26bc3f03b83ac7727396703febf Mon Sep 17 00:00:00 2001
From: unknown <reggie@linux.site>
Date: Tue, 6 Sep 2005 18:06:06 -0600
Subject: [PATCH] A few changes to fix compiling on Windows

VC++Files/mysql.sln:
  Added instance manager project
VC++Files/mysys/mysys.vcproj:
  Added mf_unixpath.c
scripts/make_win_src_distribution.sh:
  Updated to include server-tools folder (which includes IM)
server-tools/instance-manager/instance.cc:
  fixed typo
server-tools/instance-manager/mysqlmanager.vcproj:
  fixed up all the filenames in the IM project
---
 VC++Files/mysql.sln                           |  37 +++++
 VC++Files/mysys/mysys.vcproj                  |   3 +
 scripts/make_win_src_distribution.sh          |   2 +-
 server-tools/instance-manager/instance.cc     |   2 +-
 .../instance-manager/mysqlmanager.vcproj      | 148 +++++++++++++-----
 5 files changed, 155 insertions(+), 37 deletions(-)

diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln
index fc75dc24723..5b062a31aab 100755
--- a/VC++Files/mysql.sln
+++ b/VC++Files/mysql.sln
@@ -277,6 +277,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql_test_run_new", "mysql
 		{D2B00DE0-F6E9-40AF-B90D-A257D014F098} = {D2B00DE0-F6E9-40AF-B90D-A257D014F098}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlmanager", "server-tools\instance-manager\mysqlmanager.vcproj", "{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}"
+	ProjectSection(ProjectDependencies) = postProject
+		{EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859}
+		{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}
+		{DB28DE80-837F-4497-9AA9-CC0A20584C98} = {DB28DE80-837F-4497-9AA9-CC0A20584C98}
+		{8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF}
+		{F74653C4-8003-4A79-8F53-FC69E0AD7A9B} = {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}
+		{44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF}
+		{FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfiguration) = preSolution
 		classic = classic
@@ -1204,6 +1215,32 @@ Global
 		{6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.Build.0 = Release|Win32
 		{6189F838-21C6-42A1-B2D0-9146316573F7}.Release.ActiveCfg = Release|Win32
 		{6189F838-21C6-42A1-B2D0-9146316573F7}.Release.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.classic.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.classic.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.classic nt.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.classic nt.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Debug.ActiveCfg = Debug|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Debug.Build.0 = Debug|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Classic.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Classic.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Debug.ActiveCfg = Debug|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Debug.Build.0 = Debug|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Pro.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Pro.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Release.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Release.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max nt.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max nt.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.nt.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.nt.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro nt.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro nt.Build.0 = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Release.ActiveCfg = Release|Win32
+		{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Release.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 	EndGlobalSection
diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj
index 3d53fd3923c..87e9338e811 100755
--- a/VC++Files/mysys/mysys.vcproj
+++ b/VC++Files/mysys/mysys.vcproj
@@ -1638,6 +1638,9 @@
 					PreprocessorDefinitions=""/>
 			</FileConfiguration>
 		</File>
+		<File
+			RelativePath=".\mf_unixpath.c">
+		</File>
 		<File
 			RelativePath="mf_wcomp.c">
 			<FileConfiguration
diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh
index 0d2a8cdd5d7..e75dec55e82 100644
--- a/scripts/make_win_src_distribution.sh
+++ b/scripts/make_win_src_distribution.sh
@@ -266,7 +266,7 @@ make -C $SOURCE/ndb windoze
 # Input directories to be copied recursively
 #
 
-for i in bdb innobase ndb extra/yassl
+for i in bdb innobase ndb extra/yassl server-tools
 do
   copy_dir_dirs $i
 done
diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc
index 0a373429d01..7f705bac1c1 100644
--- a/server-tools/instance-manager/instance.cc
+++ b/server-tools/instance-manager/instance.cc
@@ -40,7 +40,7 @@
 static void start_and_monitor_instance(Instance_options *old_instance_options,
                                        Instance_map *instance_map);
 
-#ifndef _WIN_
+#ifndef __WIN__
 typedef pid_t My_process_info;
 #else
 typedef PROCESS_INFORMATION My_process_info;
diff --git a/server-tools/instance-manager/mysqlmanager.vcproj b/server-tools/instance-manager/mysqlmanager.vcproj
index 2ab9a4878c1..a5ef7cb21e3 100644
--- a/server-tools/instance-manager/mysqlmanager.vcproj
+++ b/server-tools/instance-manager/mysqlmanager.vcproj
@@ -19,7 +19,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\include"
+				AdditionalIncludeDirectories="..\..\include,../../extra/yassl/include"
 				PreprocessorDefinitions="MYSQL_INSTANCE_MANAGER;MYSQL_SERVER;_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;CONSOLE"
 				MinimalRebuild="TRUE"
 				ExceptionHandling="FALSE"
@@ -69,7 +69,7 @@
 			CharacterSet="2">
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\include"
+				AdditionalIncludeDirectories="..\..\include,../../extra/yassl/include"
 				PreprocessorDefinitions="MYSQL_INSTANCE_MANAGER;MYSQL_SERVER;_WINDOWS;CONSOLE"
 				ExceptionHandling="FALSE"
 				RuntimeLibrary="0"
@@ -119,94 +119,172 @@
 			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
 			<File
-				RelativePath=".\buffer.cc">
+				RelativePath=".\buffer.cpp">
 			</File>
 			<File
-				RelativePath="..\sql\client.c">
+				RelativePath="..\..\sql\client.c">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
 			</File>
 			<File
-				RelativePath=".\command.cc">
+				RelativePath=".\command.cpp">
 			</File>
 			<File
-				RelativePath=".\commands.cc">
+				RelativePath=".\commands.cpp">
 			</File>
 			<File
-				RelativePath=".\factory.cc">
+				RelativePath="..\..\libmysql\get_password.c">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\libmysql\get_password.c">
-			</File>
-			<File
-				RelativePath=".\guardian.cc">
+				RelativePath=".\guardian.cpp">
 			</File>
 			<File
 				RelativePath=".\IMService.cpp">
 			</File>
 			<File
-				RelativePath=".\instance.cc">
-			</File>
-			<File
-				RelativePath=".\instance_map.cc">
+				RelativePath=".\instance.cpp">
 			</File>
 			<File
-				RelativePath=".\instance_options.cc">
+				RelativePath=".\instance_map.cpp">
 			</File>
 			<File
-				RelativePath=".\listener.cc">
+				RelativePath=".\instance_options.cpp">
 			</File>
 			<File
-				RelativePath=".\log.cc">
+				RelativePath=".\listener.cpp">
 			</File>
 			<File
-				RelativePath=".\manager.cc">
+				RelativePath=".\log.cpp">
 			</File>
 			<File
-				RelativePath=".\messages.cc">
+				RelativePath=".\manager.cpp">
 			</File>
 			<File
-				RelativePath="..\sql\mini_client_errors.c">
+				RelativePath=".\messages.cpp">
 			</File>
 			<File
-				RelativePath=".\mysql_connection.cc">
+				RelativePath="..\..\sql\mini_client_errors.c">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
 			</File>
 			<File
-				RelativePath=".\mysqlmanager.cc">
+				RelativePath=".\mysql_connection.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\sql\net_serv.cpp">
+				RelativePath=".\mysqlmanager.cpp">
 			</File>
 			<File
-				RelativePath=".\options.cc">
+				RelativePath="..\..\sql\net_serv.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\sql\pack.c">
+				RelativePath=".\options.cpp">
 			</File>
 			<File
-				RelativePath=".\parse.cc">
+				RelativePath="..\..\sql\pack.c">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
 			</File>
 			<File
-				RelativePath=".\parse_output.cc">
+				RelativePath=".\parse.cpp">
 			</File>
 			<File
-				RelativePath="..\sql\password.c">
+				RelativePath=".\parse_output.cpp">
 			</File>
 			<File
-				RelativePath=".\priv.cc">
+				RelativePath="..\..\sql\password.c">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
 			</File>
 			<File
-				RelativePath=".\protocol.cc">
+				RelativePath=".\priv.cpp">
 			</File>
 			<File
-				RelativePath=".\service_funcs.cpp">
+				RelativePath=".\protocol.cpp">
 			</File>
 			<File
-				RelativePath="..\sql\sql_state.c">
+				RelativePath="..\..\sql\sql_state.c">
 			</File>
 			<File
-				RelativePath=".\thread_registry.cc">
+				RelativePath=".\thread_registry.cpp">
 			</File>
 			<File
-				RelativePath=".\user_map.cc">
+				RelativePath=".\user_map.cpp">
 			</File>
 			<File
 				RelativePath=".\WindowsService.cpp">
-- 
2.30.9