- auto_ptr has been deprecated
- destructors are noexcept by default
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
#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)
using namespace libtest;
static void stats_print(libtest::Framework *frame)
- 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.
{
// Run create(), bail on error.
{
+#if __cplusplus < 201103L
+# define noexcept(a)
+#endif
+
namespace libtest
{
namespace thread
namespace libtest
{
namespace thread
_err= pthread_mutex_init(&_mutex, NULL);
}
_err= pthread_mutex_init(&_mutex, NULL);
}
+ ~Mutex() noexcept(false)
{
if ((_err= pthread_mutex_destroy(&_mutex)))
{
{
if ((_err= pthread_mutex_destroy(&_mutex)))
{
+ ~ScopedLock() noexcept(false)
{
int err;
if ((err= pthread_mutex_unlock(_mutex.handle())))
{
int err;
if ((err= pthread_mutex_unlock(_mutex.handle())))
+ ~Condition() noexcept(false)
{
int err;
if ((err= pthread_cond_destroy(&_cond)))
{
int err;
if ((err= pthread_cond_destroy(&_cond)))