Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55580 - in sandbox/process/boost/process: . detail
From: boris_at_[hidden]
Date: 2009-08-14 07:37:27


Author: bschaeling
Date: 2009-08-14 07:37:26 EDT (Fri, 14 Aug 2009)
New Revision: 55580
URL: http://svn.boost.org/trac/boost/changeset/55580

Log:
applied patch to support _SCL_SECURE_NO_DEPRECATE (MSVC macro)
Text files modified:
   sandbox/process/boost/process/detail/win32_ops.hpp | 8 ++++----
   sandbox/process/boost/process/self.hpp | 10 +++++-----
   2 files changed, 9 insertions(+), 9 deletions(-)

Modified: sandbox/process/boost/process/detail/win32_ops.hpp
==============================================================================
--- sandbox/process/boost/process/detail/win32_ops.hpp (original)
+++ sandbox/process/boost/process/detail/win32_ops.hpp 2009-08-14 07:37:26 EDT (Fri, 14 Aug 2009)
@@ -81,7 +81,7 @@
     boost::shared_array<char> cmdline(new char[size]);
     cmdline.get()[0] = '\0';
     for (arguments_t::size_type i = 0; i < args.size(); ++i)
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) || defined(_SCL_SECURE_NO_DEPRECATE)
         ::strncat(cmdline.get(), args2[i].c_str(), args2[i].size());
 #else
         ::strcat_s(cmdline.get(), size, args2[i].c_str());
@@ -121,7 +121,7 @@
         }
 
         envp.reset(new char[s.size() + 1]);
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) || defined(_SCL_SECURE_NO_DEPRECATE)
         ::memcpy(envp.get(), s.c_str(), s.size() + 1);
 #else
         ::memcpy_s(envp.get(), s.size() + 1, s.c_str(), s.size() + 1);
@@ -327,14 +327,14 @@
     boost::shared_array<char> cmdline = collection_to_win32_cmdline(args);
 
     boost::scoped_array<char> executable(new char[exe.size() + 1]);
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) || defined(_SCL_SECURE_NO_DEPRECATE)
     ::strcpy(executable.get(), exe.c_str());
 #else
     ::strcpy_s(executable.get(), exe.size() + 1, exe.c_str());
 #endif
 
     boost::scoped_array<char> workdir(new char[setup.work_directory.size() + 1]);
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) || defined(_SCL_SECURE_NO_DEPRECATE)
     ::strcpy(workdir.get(), setup.work_directory.c_str());
 #else
     ::strcpy_s(workdir.get(), setup.work_directory.size() + 1, setup.work_directory.c_str());

Modified: sandbox/process/boost/process/self.hpp
==============================================================================
--- sandbox/process/boost/process/self.hpp (original)
+++ sandbox/process/boost/process/self.hpp 2009-08-14 07:37:26 EDT (Fri, 14 Aug 2009)
@@ -94,12 +94,12 @@
 #ifdef GetEnvironmentStrings
 #undef GetEnvironmentStrings
 #endif
- char *environ = ::GetEnvironmentStrings();
- if (!environ)
+ char *ms_environ = ::GetEnvironmentStrings();
+ if (!ms_environ)
             boost::throw_exception(boost::system::system_error(boost::system::error_code(::GetLastError(), boost::system::get_system_category()), "boost::process::self::get_environment: GetEnvironmentStrings failed"));
         try
         {
- char *env = environ;
+ char *env = ms_environ;
             while (*env)
             {
                 std::string s = env;
@@ -110,10 +110,10 @@
         }
         catch (...)
         {
- ::FreeEnvironmentStringsA(environ);
+ ::FreeEnvironmentStringsA(ms_environ);
             throw;
         }
- ::FreeEnvironmentStringsA(environ);
+ ::FreeEnvironmentStringsA(ms_environ);
 #endif
 
         return e;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk