Ticket #9649: boost_interprocess_custom_tmp_dir.patch

File boost_interprocess_custom_tmp_dir.patch, 1.5 KB (added by frank.richter@…, 9 years ago)

Allow fully custom interprocess temp dir name

  • boost/interprocess/detail/tmp_dir_helpers.hpp

    diff -ru boost_1_55_0.org/boost/interprocess/detail/tmp_dir_helpers.hpp boost_1_55_0/boost/interprocess/detail/tmp_dir_helpers.hpp
    old new  
    105105      throw interprocess_exception(err);
    106106   }
    107107   //Remove final null.
    108    tmp_name += "/boost_interprocess";
     108   tmp_name += "/" BOOST_INTERPROCESS_TMP_DIR;
    109109}
    110110
    111111inline void tmp_folder(std::string &tmp_name)
  • boost/interprocess/detail/workaround.hpp

    diff -ru boost_1_55_0.org/boost/interprocess/detail/workaround.hpp boost_1_55_0/boost/interprocess/detail/workaround.hpp
    old new  
    189189   #define BOOST_INTERPROCESS_NOEXCEPT_IF(x) noexcept(x)
    190190#endif
    191191
     192#if !defined(BOOST_INTERPROCESS_TMP_DIR)
     193   #if !defined(BOOST_INTERPROCESS_WINDOWS) || defined(BOOST_INTERPROCESS_BOOTSTAMP_IS_LASTBOOTUPTIME)
     194      #define BOOST_INTERPROCESS_TMP_DIR    "boost_interprocess"
     195   #else
     196      /* Use a different dir name so pre-1.54 boost::interprocess doesn't
     197       * errorneously remove the temp dir */
     198      #define BOOST_INTERPROCESS_TMP_DIR    "boost_interprocess2"
     199   #endif
     200#endif
     201
    192202#include <boost/interprocess/detail/config_end.hpp>
    193203
    194204#endif   //#ifndef BOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP