整理
This commit is contained in:
40
include/boost/winapi/detail/cast_ptr.hpp
Normal file
40
include/boost/winapi/detail/cast_ptr.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2015 Andrey Semashev
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_DETAIL_CAST_PTR_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_DETAIL_CAST_PTR_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/config.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
namespace detail {
|
||||
|
||||
//! This class is used to automatically cast pointers to the type used in the current Windows SDK function declarations
|
||||
class cast_ptr
|
||||
{
|
||||
private:
|
||||
const void* m_p;
|
||||
|
||||
public:
|
||||
explicit BOOST_FORCEINLINE cast_ptr(const void* p) BOOST_NOEXCEPT : m_p(p) {}
|
||||
template< typename T >
|
||||
BOOST_FORCEINLINE operator T* () const BOOST_NOEXCEPT { return (T*)m_p; }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_DETAIL_CAST_PTR_HPP_INCLUDED_
|
||||
21
include/boost/winapi/detail/footer.hpp
Normal file
21
include/boost/winapi/detail/footer.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2020.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_WINAPI_ENABLE_WARNINGS)
|
||||
|
||||
#if defined(_MSC_VER) && !(defined(__INTEL_COMPILER) || defined(__clang__))
|
||||
|
||||
#pragma warning(pop)
|
||||
|
||||
#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) \
|
||||
&& (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#endif
|
||||
|
||||
#endif // !defined(BOOST_WINAPI_ENABLE_WARNINGS)
|
||||
27
include/boost/winapi/detail/header.hpp
Normal file
27
include/boost/winapi/detail/header.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2020.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_WINAPI_ENABLE_WARNINGS)
|
||||
|
||||
#if defined(_MSC_VER) && !(defined(__INTEL_COMPILER) || defined(__clang__))
|
||||
|
||||
#pragma warning(push, 3)
|
||||
// nonstandard extension used : nameless struct/union
|
||||
#pragma warning(disable: 4201)
|
||||
// Inconsistent annotation for 'X'
|
||||
#pragma warning(disable: 28251)
|
||||
|
||||
#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) \
|
||||
&& (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
// ISO C++ 1998 does not support 'long long'
|
||||
#pragma GCC diagnostic ignored "-Wlong-long"
|
||||
|
||||
#endif
|
||||
|
||||
#endif // !defined(BOOST_WINAPI_ENABLE_WARNINGS)
|
||||
Reference in New Issue
Block a user