Commit 12d9d257 authored by Davis King's avatar Davis King

Put guards around some GCC specific #pragma statements to avoid warnings in

visual studio.
parent e1ff23fd
......@@ -10,6 +10,12 @@
#include "../algs.h"
#include "shared_ptr_abstract.h"
// Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of
// this file that re-enables the warning.
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace dlib
{
......@@ -294,8 +300,6 @@ namespace dlib
shared_node->ref_count += 1;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y>
explicit shared_ptr(
std::auto_ptr<Y>& r
......@@ -310,7 +314,6 @@ namespace dlib
shared_node->del = new default_deleter;
data = r.release();
}
#pragma GCC diagnostic pop
shared_ptr& operator= (
const shared_ptr& r
......@@ -329,8 +332,6 @@ namespace dlib
return *this;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y>
shared_ptr& operator= (
std::auto_ptr<Y>& r
......@@ -348,7 +349,6 @@ namespace dlib
data = r.release();
return *this;
}
#pragma GCC diagnostic pop
void reset()
{
......@@ -527,5 +527,9 @@ namespace dlib
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif // DLIB_SHARED_PTr_
......@@ -11,6 +11,13 @@
#include "shared_ptr_thread_safe_abstract.h"
#include "../threads/threads_kernel.h"
// Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of
// this file that re-enables the warning.
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace dlib
{
......@@ -257,8 +264,6 @@ namespace dlib
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y>
explicit shared_ptr_thread_safe(
std::auto_ptr<Y>& r
......@@ -272,7 +277,6 @@ namespace dlib
shared_node = new shared_ptr_thread_safe_node;
data = r.release();
}
#pragma GCC diagnostic push
shared_ptr_thread_safe& operator= (
const shared_ptr_thread_safe& r
......@@ -291,8 +295,6 @@ namespace dlib
return *this;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y>
shared_ptr_thread_safe& operator= (
std::auto_ptr<Y>& r
......@@ -309,7 +311,6 @@ namespace dlib
data = r.release();
return *this;
}
#pragma GCC diagnostic push
void reset()
{
......@@ -496,6 +497,10 @@ namespace dlib
// ----------------------------------------------------------------------------------------
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
}
#endif // DLIB_SHARED_THREAD_SAFE_PTr_
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment