Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable deprecation warnings internally #702

Merged
merged 2 commits into from
Jul 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion autowiring/C++11/cpp11.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
// If Boost.Thread is used, we want it to provide the new name for its <future> class
#define BOOST_THREAD_PROVIDES_FUTURE

#ifdef AUTOWIRING_IS_BEING_BUILT
// We know that we're using deprecated stuff in our unit tests, but the tests still
// need to do what they do. Undefine all of the deprecated macros so we don't get
// spammed with warnings telling us what we already know.
#define AUTOWIRING_NO_DEPRECATE
#endif

#ifndef __has_feature
#define __has_feature(x) (AUTOWIRE_##x)
#endif
Expand Down Expand Up @@ -339,7 +346,7 @@
/*********************
* Deprecation convenience macro
*********************/
#ifndef _DEBUG
#if !defined(_DEBUG) && !defined(AUTOWIRING_NO_DEPRECATE)
#ifdef _MSC_VER
#define DEPRECATED(signature, msg) __declspec(deprecated(msg)) signature
#define DEPRECATED_CLASS(classname, msg) __declspec(deprecated(msg)) classname
Expand Down
7 changes: 4 additions & 3 deletions autowiring/ObjectPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ class ObjectPool
{
public:
ObjectPool(void) :
ObjectPool(~0, ~0)
m_monitor(std::make_shared<ObjectPoolMonitorT<T>>(this, &DefaultInitialize<T>, &DefaultFinalize<T>)),
m_maxPooled(~0),
m_limit(~0)
{}

ObjectPool(ObjectPool&& rhs)
Expand Down Expand Up @@ -82,7 +84,6 @@ class ObjectPool
const std::function<void(T&)>& final = &DefaultFinalize<T>
) :
m_monitor(std::make_shared<ObjectPoolMonitorT<T>>(this, initial, final)),
m_alloc(&DefaultCreate<T>),
m_placement(placement)
{}

Expand Down Expand Up @@ -154,7 +155,7 @@ class ObjectPool
size_t m_outstanding = 0;

// Allocator, placement ctor:
std::function<T*()> m_alloc;
std::function<T*()> m_alloc { &DefaultCreate<T> };
std::function<void(T*)> m_placement{ [](T*) {} };

/// <summary>
Expand Down