local_memory.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright 2010 Vicente J. Botet Escriba
  3. * Copyright 2015 Andrey Semashev
  4. *
  5. * Distributed under the Boost Software License, Version 1.0.
  6. * See http://www.boost.org/LICENSE_1_0.txt
  7. */
  8. #ifndef BOOST_WINAPI_LOCAL_MEMORY_HPP_INCLUDED_
  9. #define BOOST_WINAPI_LOCAL_MEMORY_HPP_INCLUDED_
  10. #include <boost/winapi/basic_types.hpp>
  11. #ifdef BOOST_HAS_PRAGMA_ONCE
  12. #pragma once
  13. #endif
  14. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  15. #include <boost/winapi/detail/header.hpp>
  16. #if !defined( BOOST_USE_WINDOWS_H )
  17. namespace boost { namespace winapi {
  18. typedef HANDLE_ HLOCAL_;
  19. }}
  20. extern "C" {
  21. #if defined (_WIN32_WCE )
  22. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC
  23. LocalAlloc(
  24. boost::winapi::UINT_ uFlags,
  25. boost::winapi::UINT_ uBytes);
  26. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC
  27. LocalReAlloc(
  28. boost::winapi::HLOCAL_ hMem,
  29. boost::winapi::UINT_ uBytes,
  30. boost::winapi::UINT_ uFlags);
  31. #else
  32. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC
  33. LocalAlloc(
  34. boost::winapi::UINT_ uFlags,
  35. boost::winapi::SIZE_T_ uBytes);
  36. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC
  37. LocalReAlloc(
  38. boost::winapi::HLOCAL_ hMem,
  39. boost::winapi::SIZE_T_ uBytes,
  40. boost::winapi::UINT_ uFlags);
  41. #endif
  42. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC LocalFree(boost::winapi::HLOCAL_ hMem);
  43. } // extern "C"
  44. #endif
  45. namespace boost {
  46. namespace winapi {
  47. #if defined( BOOST_USE_WINDOWS_H )
  48. typedef ::HLOCAL HLOCAL_;
  49. #endif
  50. using ::LocalAlloc;
  51. using ::LocalReAlloc;
  52. using ::LocalFree;
  53. }
  54. }
  55. #include <boost/winapi/detail/footer.hpp>
  56. #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
  57. #endif // BOOST_WINAPI_LOCAL_MEMORY_HPP_INCLUDED_