system.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // system.hpp --------------------------------------------------------------//
  2. // Copyright 2010 Vicente J. Botet Escriba
  3. // Copyright (c) Microsoft Corporation 2014
  4. // Copyright 2015 Andrey Semashev
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // See http://www.boost.org/LICENSE_1_0.txt
  7. #ifndef BOOST_DETAIL_WINAPI_SYSTEM_HPP
  8. #define BOOST_DETAIL_WINAPI_SYSTEM_HPP
  9. #include <boost/detail/winapi/basic_types.hpp>
  10. #ifdef BOOST_HAS_PRAGMA_ONCE
  11. #pragma once
  12. #endif
  13. #if !defined( BOOST_USE_WINDOWS_H )
  14. extern "C" {
  15. struct _SYSTEM_INFO;
  16. BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
  17. GetSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
  18. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
  19. BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
  20. GetNativeSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
  21. #endif
  22. }
  23. #endif
  24. namespace boost {
  25. namespace detail {
  26. namespace winapi {
  27. typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SYSTEM_INFO {
  28. union {
  29. DWORD_ dwOemId;
  30. struct {
  31. WORD_ wProcessorArchitecture;
  32. WORD_ wReserved;
  33. } DUMMYSTRUCTNAME;
  34. } DUMMYUNIONNAME;
  35. DWORD_ dwPageSize;
  36. LPVOID_ lpMinimumApplicationAddress;
  37. LPVOID_ lpMaximumApplicationAddress;
  38. DWORD_PTR_ dwActiveProcessorMask;
  39. DWORD_ dwNumberOfProcessors;
  40. DWORD_ dwProcessorType;
  41. DWORD_ dwAllocationGranularity;
  42. WORD_ wProcessorLevel;
  43. WORD_ wProcessorRevision;
  44. } SYSTEM_INFO_, *LPSYSTEM_INFO_;
  45. BOOST_FORCEINLINE VOID_ GetSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
  46. {
  47. ::GetSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
  48. }
  49. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
  50. BOOST_FORCEINLINE VOID_ GetNativeSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
  51. {
  52. ::GetNativeSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
  53. }
  54. #endif
  55. }
  56. }
  57. }
  58. #endif // BOOST_DETAIL_WINAPI_SYSTEM_HPP