windows.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // Copyright (c) 2012 Artyom Beilis (Tonkikh)
  3. // Copyright (c) 2022 Alexander Grund
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // https://www.boost.org/LICENSE_1_0.txt
  7. #ifndef BOOST_NOWIDE_WINDOWS_HPP_INCLUDED
  8. #define BOOST_NOWIDE_WINDOWS_HPP_INCLUDED
  9. #ifdef BOOST_USE_WINDOWS_H
  10. #include <windows.h>
  11. // (Usually) included by windows.h
  12. #include <shellapi.h>
  13. #else
  14. // When BOOST_USE_WINDOWS_H is not defined we declare the function prototypes to avoid including windows.h
  15. extern "C" {
  16. // From windows.h
  17. __declspec(dllimport) wchar_t* __stdcall GetEnvironmentStringsW(void);
  18. __declspec(dllimport) int __stdcall FreeEnvironmentStringsW(wchar_t*);
  19. __declspec(dllimport) wchar_t* __stdcall GetCommandLineW(void);
  20. __declspec(dllimport) unsigned long __stdcall GetLastError();
  21. __declspec(dllimport) void* __stdcall LocalFree(void*);
  22. __declspec(dllimport) int __stdcall SetEnvironmentVariableW(const wchar_t*, const wchar_t*);
  23. __declspec(dllimport) unsigned long __stdcall GetEnvironmentVariableW(const wchar_t*, wchar_t*, unsigned long);
  24. // From shellapi.h
  25. __declspec(dllimport) wchar_t** __stdcall CommandLineToArgvW(const wchar_t*, int*);
  26. }
  27. #endif
  28. #endif