From 8d58643655b653c520fcdcc2a89b5067788f32fc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Dec 2009 10:33:07 +0100 Subject: MSVC build for chat example added --- builds/msvc/display/display.vcproj | 176 +++++++++++++++++++++++++++++++++++++ builds/msvc/msvc.sln | 18 ++++ builds/msvc/prompt/prompt.vcproj | 176 +++++++++++++++++++++++++++++++++++++ examples/chat/prompt.cpp | 5 ++ 4 files changed, 375 insertions(+) create mode 100644 builds/msvc/display/display.vcproj create mode 100644 builds/msvc/prompt/prompt.vcproj diff --git a/builds/msvc/display/display.vcproj b/builds/msvc/display/display.vcproj new file mode 100644 index 0000000..745a1c8 --- /dev/null +++ b/builds/msvc/display/display.vcproj @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/builds/msvc/msvc.sln b/builds/msvc/msvc.sln index 8b7d8d0..cb3b3ef 100644 --- a/builds/msvc/msvc.sln +++ b/builds/msvc/msvc.sln @@ -78,6 +78,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zmq_forwarder", "zmq_forwar {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "display", "display\display.vcproj", "{1069FAF7-996A-4B76-AF88-F1D9783FF340}" + ProjectSection(ProjectDependencies) = postProject + {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "prompt", "prompt\prompt.vcproj", "{95EE421B-EBA2-4A16-8855-A978F463241E}" + ProjectSection(ProjectDependencies) = postProject + {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -147,6 +157,14 @@ Global {EFE471DE-6747-4B2E-B084-F7E45A16CD03}.Debug|Win32.Build.0 = Debug|Win32 {EFE471DE-6747-4B2E-B084-F7E45A16CD03}.Release|Win32.ActiveCfg = Release|Win32 {EFE471DE-6747-4B2E-B084-F7E45A16CD03}.Release|Win32.Build.0 = Release|Win32 + {1069FAF7-996A-4B76-AF88-F1D9783FF340}.Debug|Win32.ActiveCfg = Debug|Win32 + {1069FAF7-996A-4B76-AF88-F1D9783FF340}.Debug|Win32.Build.0 = Debug|Win32 + {1069FAF7-996A-4B76-AF88-F1D9783FF340}.Release|Win32.ActiveCfg = Release|Win32 + {1069FAF7-996A-4B76-AF88-F1D9783FF340}.Release|Win32.Build.0 = Release|Win32 + {95EE421B-EBA2-4A16-8855-A978F463241E}.Debug|Win32.ActiveCfg = Debug|Win32 + {95EE421B-EBA2-4A16-8855-A978F463241E}.Debug|Win32.Build.0 = Debug|Win32 + {95EE421B-EBA2-4A16-8855-A978F463241E}.Release|Win32.ActiveCfg = Release|Win32 + {95EE421B-EBA2-4A16-8855-A978F463241E}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/builds/msvc/prompt/prompt.vcproj b/builds/msvc/prompt/prompt.vcproj new file mode 100644 index 0000000..7368a42 --- /dev/null +++ b/builds/msvc/prompt/prompt.vcproj @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/chat/prompt.cpp b/examples/chat/prompt.cpp index 6132d63..72b0195 100644 --- a/examples/chat/prompt.cpp +++ b/examples/chat/prompt.cpp @@ -42,7 +42,12 @@ int main (int argc, const char *argv []) // Prepare a message buffer. Place username at the beginning // of the message. char textbuf [1024]; +#ifdef _MSC_VER + _snprintf_s (textbuf, sizeof (textbuf), sizeof (textbuf), "%s: ", + username); +#else snprintf (textbuf, sizeof (textbuf), "%s: ", username); +#endif size_t prefixsz = strlen (textbuf); char *text = textbuf + prefixsz; -- cgit v1.2.3