Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
a169a05e
Commit
a169a05e
authored
May 19, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32, ...: avoid including windows.h
Include the most specific header documented by MSDN instead.
parent
a6cb3139
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
38 additions
and
17 deletions
+38
-17
DirectoryReader.hxx
src/fs/DirectoryReader.hxx
+1
-1
FileOutputStream.hxx
src/fs/io/FileOutputStream.hxx
+4
-1
FileReader.hxx
src/fs/io/FileReader.hxx
+4
-1
WinmmOutputPlugin.cxx
src/output/plugins/WinmmOutputPlugin.cxx
+4
-0
WinmmOutputPlugin.hxx
src/output/plugins/WinmmOutputPlugin.hxx
+1
-1
Error.hxx
src/system/Error.hxx
+3
-1
FatalError.cxx
src/system/FatalError.cxx
+3
-1
CriticalSection.hxx
src/thread/CriticalSection.hxx
+1
-1
Id.hxx
src/thread/Id.hxx
+1
-1
Thread.hxx
src/thread/Thread.hxx
+1
-1
WindowsCond.hxx
src/thread/WindowsCond.hxx
+3
-0
HugeAllocator.hxx
src/util/HugeAllocator.hxx
+1
-1
Com.hxx
src/win32/Com.hxx
+2
-2
ComHeapPtr.hxx
src/win32/ComHeapPtr.hxx
+2
-1
ComPtr.hxx
src/win32/ComPtr.hxx
+3
-1
ComWorker.hxx
src/win32/ComWorker.hxx
+0
-2
WinEvent.hxx
src/win32/WinEvent.hxx
+4
-1
No files found.
src/fs/DirectoryReader.hxx
View file @
a169a05e
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#ifdef _WIN32
#ifdef _WIN32
#include <
windows
.h>
#include <
fileapi
.h>
#include <tchar.h>
#include <tchar.h>
/**
/**
...
...
src/fs/io/FileOutputStream.hxx
View file @
a169a05e
...
@@ -42,7 +42,10 @@
...
@@ -42,7 +42,10 @@
#include <cstdint>
#include <cstdint>
#ifdef _WIN32
#ifdef _WIN32
#include <windows.h>
#include <fileapi.h>
#include <windef.h> // for HWND (needed by winbase.h)
#include <handleapi.h> // for INVALID_HANDLE_VALUE
#include <winbase.h> // for FILE_END
#endif
#endif
#if defined(__linux__) && !defined(ANDROID)
#if defined(__linux__) && !defined(ANDROID)
...
...
src/fs/io/FileReader.hxx
View file @
a169a05e
...
@@ -35,7 +35,10 @@
...
@@ -35,7 +35,10 @@
#include "util/Compiler.h"
#include "util/Compiler.h"
#ifdef _WIN32
#ifdef _WIN32
#include <windows.h>
#include <fileapi.h>
#include <handleapi.h> // for INVALID_HANDLE_VALUE
#include <windef.h> // for HWND (needed by winbase.h)
#include <winbase.h> // for FILE_CURRENT
#else
#else
#include "io/UniqueFileDescriptor.hxx"
#include "io/UniqueFileDescriptor.hxx"
#endif
#endif
...
...
src/output/plugins/WinmmOutputPlugin.cxx
View file @
a169a05e
...
@@ -28,6 +28,10 @@
...
@@ -28,6 +28,10 @@
#include <array>
#include <array>
#include <iterator>
#include <iterator>
#include <handleapi.h>
#include <synchapi.h>
#include <winbase.h> // for INFINITE
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
...
...
src/output/plugins/WinmmOutputPlugin.hxx
View file @
a169a05e
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include "util/Compiler.h"
#include "util/Compiler.h"
#include <wind
ows
.h>
#include <wind
ef
.h>
#include <mmsystem.h>
#include <mmsystem.h>
struct
WinmmOutput
;
struct
WinmmOutput
;
...
...
src/system/Error.hxx
View file @
a169a05e
...
@@ -49,7 +49,9 @@ FormatSystemError(std::error_code code, const char *fmt,
...
@@ -49,7 +49,9 @@ FormatSystemError(std::error_code code, const char *fmt,
#ifdef _WIN32
#ifdef _WIN32
#include <windows.h>
#include <errhandlingapi.h> // for GetLastError()
#include <windef.h> // for HWND (needed by winbase.h)
#include <winbase.h> // for FormatMessageA()
static
inline
std
::
system_error
static
inline
std
::
system_error
MakeLastError
(
DWORD
code
,
const
char
*
msg
)
noexcept
MakeLastError
(
DWORD
code
,
const
char
*
msg
)
noexcept
...
...
src/system/FatalError.cxx
View file @
a169a05e
...
@@ -27,7 +27,9 @@
...
@@ -27,7 +27,9 @@
#include <cstring>
#include <cstring>
#ifdef _WIN32
#ifdef _WIN32
#include <windows.h>
#include <errhandlingapi.h> // for GetLastError()
#include <windef.h> // for HWND (needed by winbase.h)
#include <winbase.h> // for FormatMessageA()
#else
#else
#include <cerrno>
#include <cerrno>
#endif
#endif
...
...
src/thread/CriticalSection.hxx
View file @
a169a05e
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#ifndef THREAD_CRITICAL_SECTION_HXX
#ifndef THREAD_CRITICAL_SECTION_HXX
#define THREAD_CRITICAL_SECTION_HXX
#define THREAD_CRITICAL_SECTION_HXX
#include <
windows
.h>
#include <
synchapi
.h>
/**
/**
* Wrapper for a CRITICAL_SECTION, backend for the Mutex class.
* Wrapper for a CRITICAL_SECTION, backend for the Mutex class.
...
...
src/thread/Id.hxx
View file @
a169a05e
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include "util/Compiler.h"
#include "util/Compiler.h"
#ifdef _WIN32
#ifdef _WIN32
#include <
windows
.h>
#include <
processthreadsapi
.h>
#else
#else
#include <pthread.h>
#include <pthread.h>
#endif
#endif
...
...
src/thread/Thread.hxx
View file @
a169a05e
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include <cassert>
#include <cassert>
#ifdef _WIN32
#ifdef _WIN32
#include <
windows
.h>
#include <
processthreadsapi
.h>
#else
#else
#include <pthread.h>
#include <pthread.h>
#endif
#endif
...
...
src/thread/WindowsCond.hxx
View file @
a169a05e
...
@@ -32,6 +32,9 @@
...
@@ -32,6 +32,9 @@
#include "CriticalSection.hxx"
#include "CriticalSection.hxx"
#include <windef.h> // for HWND (needed by winbase.h)
#include <winbase.h> // for INFINITE
#include <chrono>
#include <chrono>
#include <mutex>
#include <mutex>
...
...
src/util/HugeAllocator.hxx
View file @
a169a05e
...
@@ -77,7 +77,7 @@ void
...
@@ -77,7 +77,7 @@ void
HugeDiscard
(
void
*
p
,
size_t
size
)
noexcept
;
HugeDiscard
(
void
*
p
,
size_t
size
)
noexcept
;
#elif defined(_WIN32)
#elif defined(_WIN32)
#include <
windows
.h>
#include <
memoryapi
.h>
WritableBuffer
<
void
>
WritableBuffer
<
void
>
HugeAllocate
(
size_t
size
);
HugeAllocate
(
size_t
size
);
...
...
src/win32/Com.hxx
View file @
a169a05e
...
@@ -21,8 +21,8 @@
...
@@ -21,8 +21,8 @@
#define MPD_WIN32_COM_HXX
#define MPD_WIN32_COM_HXX
#include "HResult.hxx"
#include "HResult.hxx"
#include <objbase.h>
#include <
windows
.h>
#include <
combaseapi
.h>
// RAII for Microsoft Component Object Model(COM)
// RAII for Microsoft Component Object Model(COM)
// https://docs.microsoft.com/en-us/windows/win32/api/_com/
// https://docs.microsoft.com/en-us/windows/win32/api/_com/
...
...
src/win32/ComHeapPtr.hxx
View file @
a169a05e
...
@@ -23,7 +23,8 @@
...
@@ -23,7 +23,8 @@
#include <cstddef>
#include <cstddef>
#include <objbase.h>
#include <objbase.h>
#include <utility>
#include <utility>
#include <windows.h>
#include <combaseapi.h>
// RAII for CoTaskMemAlloc and CoTaskMemFree
// RAII for CoTaskMemAlloc and CoTaskMemFree
// https://docs.microsoft.com/zh-tw/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemalloc
// https://docs.microsoft.com/zh-tw/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemalloc
...
...
src/win32/ComPtr.hxx
View file @
a169a05e
...
@@ -21,10 +21,12 @@
...
@@ -21,10 +21,12 @@
#define MPD_WIN32_COMPTR_HXX
#define MPD_WIN32_COMPTR_HXX
#include "win32/HResult.hxx"
#include "win32/HResult.hxx"
#include <cstddef>
#include <cstddef>
#include <objbase.h>
#include <objbase.h>
#include <utility>
#include <utility>
#include <windows.h>
#include <combaseapi.h>
// RAII for Object in Microsoft Component Object Model(COM)
// RAII for Object in Microsoft Component Object Model(COM)
// https://docs.microsoft.com/zh-tw/windows/win32/api/_com/
// https://docs.microsoft.com/zh-tw/windows/win32/api/_com/
...
...
src/win32/ComWorker.hxx
View file @
a169a05e
...
@@ -26,8 +26,6 @@
...
@@ -26,8 +26,6 @@
#include <boost/lockfree/spsc_queue.hpp>
#include <boost/lockfree/spsc_queue.hpp>
#include <windows.h>
// Worker thread for all COM operation
// Worker thread for all COM operation
class
COMWorker
{
class
COMWorker
{
Thread
thread
{
BIND_THIS_METHOD
(
Work
)};
Thread
thread
{
BIND_THIS_METHOD
(
Work
)};
...
...
src/win32/WinEvent.hxx
View file @
a169a05e
...
@@ -20,7 +20,10 @@
...
@@ -20,7 +20,10 @@
#ifndef MPD_WIN32_WINEVENT_HXX
#ifndef MPD_WIN32_WINEVENT_HXX
#define MPD_WIN32_WINEVENT_HXX
#define MPD_WIN32_WINEVENT_HXX
#include <windows.h>
#include <handleapi.h>
#include <synchapi.h>
#include <windef.h> // for HWND (needed by winbase.h)
#include <winbase.h> // for INFINITE
// RAII for Windows unnamed event object
// RAII for Windows unnamed event object
// https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventw
// https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventw
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment