getenv.hpp 936 B

123456789101112131415161718192021222324252627282930313233343536
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
  3. //
  4. // Distributed under the Boost Software License, Version 1.0
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. //
  8. // See http://boostorg.github.com/compute for more information.
  9. //---------------------------------------------------------------------------//
  10. #ifndef BOOST_COMPUTE_DETAIL_GETENV_HPP
  11. #define BOOST_COMPUTE_DETAIL_GETENV_HPP
  12. #include <cstdlib>
  13. namespace boost {
  14. namespace compute {
  15. namespace detail {
  16. inline const char* getenv(const char *env_var)
  17. {
  18. #ifdef _MSC_VER
  19. # pragma warning(push)
  20. # pragma warning(disable: 4996)
  21. #endif
  22. return std::getenv(env_var);
  23. #ifdef _MSC_VER
  24. # pragma warning(pop)
  25. #endif
  26. }
  27. } // end detail namespace
  28. } // end compute namespace
  29. } // end boost namespace
  30. #endif // BOOST_COMPUTE_DETAIL_GETENV_HPP