1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/archive/tmpdir.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,49 @@
1.4 +#ifndef BOOST_ARCHIVE_TMPDIR_HPP
1.5 +#define BOOST_ARCHIVE_TMPDIR_HPP
1.6 +
1.7 +// MS compatible compilers support #pragma once
1.8 +#if defined(_MSC_VER) && (_MSC_VER >= 1020)
1.9 +# pragma once
1.10 +#endif
1.11 +
1.12 +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
1.13 +// tmpdir.hpp:
1.14 +
1.15 +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
1.16 +// Use, modification and distribution is subject to the Boost Software
1.17 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
1.18 +// http://www.boost.org/LICENSE_1_0.txt)
1.19 +
1.20 +// See http://www.boost.org for updates, documentation, and revision history.
1.21 +
1.22 +#include <cstdlib> // getenv
1.23 +#include <cassert>
1.24 +
1.25 +#include <boost/config.hpp>
1.26 +#ifdef BOOST_NO_STDC_NAMESPACE
1.27 +namespace std {
1.28 + using ::getenv;
1.29 +}
1.30 +#endif
1.31 +
1.32 +namespace boost {
1.33 +namespace archive {
1.34 +
1.35 +inline char * tmpdir(){
1.36 + char *dirname;
1.37 + dirname = std::getenv("TMP");
1.38 + if(NULL == dirname)
1.39 + dirname = std::getenv("TMPDIR");
1.40 + if(NULL == dirname)
1.41 + dirname = std::getenv("TEMP");
1.42 + if(NULL == dirname){
1.43 + //assert(false); // no temp directory found
1.44 + dirname = ".";
1.45 + }
1.46 + return dirname;
1.47 +}
1.48 +
1.49 +} // archive
1.50 +} // boost
1.51 +
1.52 +#endif // BOOST_ARCHIVE_TMPDIR_HPP