stacktrace, exec amd sys/mman.h are not available in windows

master
Marc Wäckerlin 8 years ago
parent c901c00ba1
commit df16c058fd
  1. 9
      configure.ac
  2. 6
      src/mrw/auto.hxx
  3. 1
      test/mrwexclog4cxx_test.cxx
  4. 1
      test/mrwexcstderr_test.cxx

@ -62,7 +62,8 @@ AM_CONDITIONAL(HAVE_DIR, test "$have_dir" = "yes")
AC_ARG_ENABLE(exec,
AS_HELP_STRING([--disable-exec],
[disable UNIX fork and execute with pipes]),
[have_exec="$enableval"])
[have_exec="$enableval"],
[if "$MINGW" = "1"; then have_exec="no"; else have_exec="yes"; fi])
AM_CONDITIONAL(HAVE_EXEC, test "$have_exec" = "yes")
AC_ARG_ENABLE(regexp,
AS_HELP_STRING([--disable-regexp],
@ -86,7 +87,8 @@ AC_ARG_ENABLE(dynamicstack,
AC_ARG_ENABLE(stacktrace,
AS_HELP_STRING([--disable-stacktrace],
[disable stack trace, use this if you cannot compile the library on your system otherwise and you still want to use the other parts]),
[have_stacktrace="$enableval"], [have_stacktrace="yes"])
[have_stacktrace="$enableval"],
[if "$MINGW" = "1"; then have_stacktrace="no"; else have_stacktrace="yes"; fi])
AM_CONDITIONAL(HAVE_STACKTRACE, test "$have_stacktrace" = "yes")
if test "$have_stacktrace" = "yes"; then
# Hack for bug:
@ -169,8 +171,9 @@ AM_CONDITIONAL(HAVE_BOOST_THREAD, test -n "$BOOST_THREAD_LIB")
# special dependencies for specific distros
AX_ALL_BUILD_DEPEND_DEV(binutils)
AX_ALL_DEPEND_IFEXISTS_DEV(libiberty)
AX_ALL_DEPEND_IFEXISTS_DEV(liblog4cxx)
AX_ALL_DEPEND_IFEXISTS_DEV(liblog4cxx10)
AX_DEB_BUILD_DEPEND(libboost-dev)
AX_DEB_BUILD_DEPEND(liblog4cxx-dev)
AX_DEB_BUILD_DEPEND(libz-dev)
AX_RPM_BUILD_DEPEND(boost-devel)
AX_RPM_BUILD_DEPEND(zlib-devel)

@ -13,7 +13,9 @@
#define __MRW_AUTO_HPP__
#include <sys/types.h> // size_t
#include <sys/mman.h> // munmap, PROT_READ, MAP_SHARED
#if !(defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__CYGWIN__))
# include <sys/mman.h> // munmap, PROT_READ, MAP_SHARED
#endif
#include <unistd.h> // close
#include <stdexcept>
#include <cassert>
@ -374,6 +376,7 @@ namespace mrw {
*/
typedef mrw::AutoResource<int, int(*)(int), &close, int, -1> AutoFile;
#if !(defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__CYGWIN__))
/** @brief Resource handle for @c mmap.
It integrates pointer and size of a memory mapped file similar
@ -445,6 +448,7 @@ namespace mrw {
/// Forbidden to instanciate.
Auto(); Auto(const Auto&);
};
#endif
//@}
}

@ -72,6 +72,7 @@ namespace mrw {
exit_catchUnexpected = true;
}
void testcase() {
std::set_unexpected([]{throw std::bad_exception();});
catchUnexpected();
CPPUNIT_ASSERT(enter_catchUnexpected &&
enter_passUnexpected &&

@ -71,6 +71,7 @@ namespace mrw {
exit_catchUnexpected = true;
}
void testcase() {
std::set_unexpected([]{throw std::bad_exception();});
catchUnexpected();
CPPUNIT_ASSERT(enter_catchUnexpected &&
enter_passUnexpected &&

Loading…
Cancel
Save