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 @@ ...@@ -10,6 +10,12 @@
#include "../algs.h" #include "../algs.h"
#include "shared_ptr_abstract.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 namespace dlib
{ {
...@@ -294,8 +300,6 @@ namespace dlib ...@@ -294,8 +300,6 @@ namespace dlib
shared_node->ref_count += 1; shared_node->ref_count += 1;
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y> template<typename Y>
explicit shared_ptr( explicit shared_ptr(
std::auto_ptr<Y>& r std::auto_ptr<Y>& r
...@@ -310,7 +314,6 @@ namespace dlib ...@@ -310,7 +314,6 @@ namespace dlib
shared_node->del = new default_deleter; shared_node->del = new default_deleter;
data = r.release(); data = r.release();
} }
#pragma GCC diagnostic pop
shared_ptr& operator= ( shared_ptr& operator= (
const shared_ptr& r const shared_ptr& r
...@@ -329,8 +332,6 @@ namespace dlib ...@@ -329,8 +332,6 @@ namespace dlib
return *this; return *this;
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y> template<typename Y>
shared_ptr& operator= ( shared_ptr& operator= (
std::auto_ptr<Y>& r std::auto_ptr<Y>& r
...@@ -348,7 +349,6 @@ namespace dlib ...@@ -348,7 +349,6 @@ namespace dlib
data = r.release(); data = r.release();
return *this; return *this;
} }
#pragma GCC diagnostic pop
void reset() void reset()
{ {
...@@ -527,5 +527,9 @@ namespace dlib ...@@ -527,5 +527,9 @@ namespace dlib
} }
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif // DLIB_SHARED_PTr_ #endif // DLIB_SHARED_PTr_
...@@ -11,6 +11,13 @@ ...@@ -11,6 +11,13 @@
#include "shared_ptr_thread_safe_abstract.h" #include "shared_ptr_thread_safe_abstract.h"
#include "../threads/threads_kernel.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 namespace dlib
{ {
...@@ -257,8 +264,6 @@ namespace dlib ...@@ -257,8 +264,6 @@ namespace dlib
} }
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y> template<typename Y>
explicit shared_ptr_thread_safe( explicit shared_ptr_thread_safe(
std::auto_ptr<Y>& r std::auto_ptr<Y>& r
...@@ -272,7 +277,6 @@ namespace dlib ...@@ -272,7 +277,6 @@ namespace dlib
shared_node = new shared_ptr_thread_safe_node; shared_node = new shared_ptr_thread_safe_node;
data = r.release(); data = r.release();
} }
#pragma GCC diagnostic push
shared_ptr_thread_safe& operator= ( shared_ptr_thread_safe& operator= (
const shared_ptr_thread_safe& r const shared_ptr_thread_safe& r
...@@ -291,8 +295,6 @@ namespace dlib ...@@ -291,8 +295,6 @@ namespace dlib
return *this; return *this;
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y> template<typename Y>
shared_ptr_thread_safe& operator= ( shared_ptr_thread_safe& operator= (
std::auto_ptr<Y>& r std::auto_ptr<Y>& r
...@@ -309,7 +311,6 @@ namespace dlib ...@@ -309,7 +311,6 @@ namespace dlib
data = r.release(); data = r.release();
return *this; return *this;
} }
#pragma GCC diagnostic push
void reset() void reset()
{ {
...@@ -496,6 +497,10 @@ namespace dlib ...@@ -496,6 +497,10 @@ namespace dlib
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
} }
#endif // DLIB_SHARED_THREAD_SAFE_PTr_ #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