File indexing completed on 2025-01-18 09:28:30
0001 #ifndef BOOST_ARCHIVE_TMPDIR_HPP
0002 #define BOOST_ARCHIVE_TMPDIR_HPP
0003
0004
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <cstdlib> // getenv
0020 #include <cstddef> // NULL
0021
0022 #include <boost/config.hpp>
0023 #ifdef BOOST_NO_STDC_NAMESPACE
0024 namespace std {
0025 using ::getenv;
0026 }
0027 #endif
0028
0029 namespace boost {
0030 namespace archive {
0031
0032 inline const char * tmpdir(){
0033 const char *dirname;
0034 dirname = std::getenv("TMP");
0035 if(NULL == dirname)
0036 dirname = std::getenv("TMPDIR");
0037 if(NULL == dirname)
0038 dirname = std::getenv("TEMP");
0039 if(NULL == dirname){
0040
0041 dirname = ".";
0042 }
0043 return dirname;
0044 }
0045
0046 }
0047 }
0048
0049 #endif