Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
12d9d257
Commit
12d9d257
authored
Jan 16, 2016
by
Davis King
Browse files
Put guards around some GCC specific #pragma statements to avoid warnings in
visual studio.
parent
e1ff23fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
+21
-12
dlib/smart_pointers/shared_ptr.h
dlib/smart_pointers/shared_ptr.h
+10
-6
dlib/smart_pointers/shared_ptr_thread_safe.h
dlib/smart_pointers/shared_ptr_thread_safe.h
+11
-6
No files found.
dlib/smart_pointers/shared_ptr.h
View file @
12d9d257
...
...
@@ -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_
dlib/smart_pointers/shared_ptr_thread_safe.h
View file @
12d9d257
...
...
@@ -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_
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment