#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
+#if __cplusplus >= 201103L
+# define UNIQUE_PTR std::unique_ptr
+#else
+# define UNIQUE_PTR std::auto_ptr
+#endif
+
using namespace libtest;
static void stats_print(libtest::Framework *frame)
return EXIT_FAILURE;
}
- std::auto_ptr<libtest::Framework> frame(new libtest::Framework(signal, binary_name, collection_to_run, wildcard));
+ UNIQUE_PTR<libtest::Framework> frame(new libtest::Framework(signal, binary_name, collection_to_run, wildcard));
// Run create(), bail on error.
{
#include <pthread.h>
+#if __cplusplus < 201103L
+# define noexcept(a)
+#endif
+
namespace libtest
{
namespace thread
_err= pthread_mutex_init(&_mutex, NULL);
}
- ~Mutex()
+ ~Mutex() noexcept(false)
{
if ((_err= pthread_mutex_destroy(&_mutex)))
{
init();
}
- ~ScopedLock()
+ ~ScopedLock() noexcept(false)
{
int err;
if ((err= pthread_mutex_unlock(_mutex.handle())))
}
}
- ~Condition()
+ ~Condition() noexcept(false)
{
int err;
if ((err= pthread_cond_destroy(&_cond)))