environment.ipp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // boost/process/v2/impl/environment.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2022 Klemens D. Morgenstern (klemens dot morgenstern at gmx dot net)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef BOOST_PROCESS_V2_IMPL_ENVIRONMENT_IPP
  11. #define BOOST_PROCESS_V2_IMPL_ENVIRONMENT_IPP
  12. #include <boost/process/v2/detail/config.hpp>
  13. #include <boost/process/v2/default_launcher.hpp>
  14. #include <boost/process/v2/environment.hpp>
  15. BOOST_PROCESS_V2_BEGIN_NAMESPACE
  16. #if defined(BOOST_PROCESS_V2_WINDOWS)
  17. error_code process_environment::on_setup(windows::default_launcher & launcher, const filesystem::path &, const std::wstring &)
  18. {
  19. if (!unicode_env.empty() && !ec)
  20. {
  21. launcher.creation_flags |= CREATE_UNICODE_ENVIRONMENT ;
  22. launcher.environment = unicode_env.data();
  23. }
  24. return ec;
  25. };
  26. #else
  27. error_code process_environment::on_setup(posix::default_launcher & launcher, const filesystem::path &, const char * const *)
  28. {
  29. launcher.env = env.data();
  30. return error_code{};
  31. };
  32. #endif
  33. BOOST_PROCESS_V2_END_NAMESPACE
  34. #endif //BOOST_PROCESS_V2_IMPL_ENVIRONMENT_IPP