Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
12d9d257
Commit
12d9d257
authored
Jan 16, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put guards around some GCC specific #pragma statements to avoid warnings in
visual studio.
parent
e1ff23fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
+21
-12
shared_ptr.h
dlib/smart_pointers/shared_ptr.h
+10
-6
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