mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-03-21 17:49:58 -05:00
Merge d702ef984a into 12935d5b25
This commit is contained in:
commit
9f72ed7599
|
|
@ -207,6 +207,8 @@ Summary:
|
|||
- The preferred form of the increment and decrement operator in for-loops is prefix-form (e.g. `++var`).
|
||||
|
||||
## <a name="cpp-code-headers"></a>Headers
|
||||
- When including Windows‑specific headers (e.g., windows.h, winnt.h, shlwapi.h), the #include directive must be lower case as some cross-compilers (e.g. MingW) may be used on case-sensitive filesystems such as Linux, where the files are typically lower case.
|
||||
- `#include <windows.h>`
|
||||
- If a header is not necessary in a certain source file, remove them.
|
||||
- If you find duplicate includes of a certain header, remove it.
|
||||
- When declaring includes in a source file, make sure they follow the given pattern:
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "Core/Config/MainSettings.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Objbase.h>
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
|
||||
// ~10 ms - needs to be at least 240 for surround
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include <cubeb/cubeb.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Objbase.h>
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
|
||||
static void LogCallback(const char* format, ...)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
// clang-format off
|
||||
#include <initguid.h>
|
||||
#include <Audioclient.h>
|
||||
#include <audioclient.h>
|
||||
#include <mmdeviceapi.h>
|
||||
#include <functiondiscoverykeys_devpkey.h>
|
||||
#include <wil/resource.h>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#ifdef _WIN32
|
||||
|
||||
// clang-format off
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <mmreg.h>
|
||||
#include <objbase.h>
|
||||
#include <wil/resource.h>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#include "Common/SmallVector.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
#include <libkern/OSCacheControl.h>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#ifdef __APPLE__
|
||||
#include <sys/sysctl.h>
|
||||
#elif defined(_WIN32)
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <arm64intr.h>
|
||||
#include "Common/WindowsRegistry.h"
|
||||
#elif defined(__linux__)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <SetupAPI.h>
|
||||
#include <setupapi.h>
|
||||
|
||||
#define strerror_r(err, buf, len) strerror_s(buf, len, err)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2008 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include <fmt/format.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
#include "Common/Logging/Log.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <Windows.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#elifdef ANDROID
|
||||
#include "jni/AndroidCommon/AndroidCommon.h"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@
|
|||
#include "Common/StringUtil.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <Shlwapi.h>
|
||||
#include <windows.h>
|
||||
#include <commdlg.h> // for GetSaveFileName
|
||||
#include <direct.h> // getcwd
|
||||
#include <io.h>
|
||||
#include <objbase.h> // guid stuff
|
||||
#include <shellapi.h>
|
||||
#include <shlwapi.h>
|
||||
#else
|
||||
#include <libgen.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
#include "Common/LdrWatcher.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <TlHelp32.h>
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <tlhelp32.h>
|
||||
#include <winternl.h>
|
||||
|
||||
typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#else
|
||||
#include <WinSock2.h>
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "Common/QoSSession.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <Qos2.h>
|
||||
#include <qos2.h>
|
||||
#pragma comment(lib, "qwave")
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <WinSock2.h>
|
||||
#include <mutex>
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
namespace Common
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#include "Common/Logging/Log.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
constexpr u32 CODEPAGE_SHIFT_JIS = 932;
|
||||
constexpr u32 CODEPAGE_WINDOWS_1252 = 1252;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "Common/Thread.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <processthreadsapi.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "Common/CommonFuncs.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <timeapi.h>
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "Hidclass.h"
|
||||
#include "hidclass.h"
|
||||
|
||||
#include "Common/CommonFuncs.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
|
|
|||
|
|
@ -16,11 +16,10 @@
|
|||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#include <Windows.h>
|
||||
|
||||
#include <SetupAPI.h>
|
||||
#include <windows.h>
|
||||
#include <cfgmgr32.h>
|
||||
#include <devpropdef.h>
|
||||
#include <setupapi.h>
|
||||
|
||||
#include "Common/Functional.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "Common/WindowsRegistry.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include "Common/StringUtil.h"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <vector>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "Common/Assert.h"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include <fmt/format.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include "Common/WindowsRegistry.h"
|
||||
#elif defined(__APPLE__)
|
||||
#include <objc/message.h>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "Core/HW/DSPHLE/UCodes/ROM.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <memory>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <WinSock2.h>
|
||||
#include <winsock2.h>
|
||||
using socklen_t = int;
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "SFML/Network/IpAddress.hpp"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <SFML/Network.hpp>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "Core/System.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Objbase.h>
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
|
||||
namespace ExpansionInterface
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <Windows.h>
|
||||
#include <BluetoothAPIs.h>
|
||||
#include <Cfgmgr32.h>
|
||||
#include <Hidclass.h>
|
||||
#include <Hidsdi.h>
|
||||
#include <windows.h>
|
||||
#include <bluetoothapis.h>
|
||||
#include <cfgmgr32.h>
|
||||
#include <hidclass.h>
|
||||
#include <hidsdi.h>
|
||||
#include <initguid.h>
|
||||
#include <wtypes.h>
|
||||
// initguid.h must be included before devpkey.h
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
// TODO: Horrible hack, remove ASAP!
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <WinSock2.h>
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <WinSock2.h>
|
||||
#include <iphlpapi.h>
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
|
||||
typedef pollfd pollfd_t;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#include "Core/System.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Objbase.h>
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <mutex>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <WinSock2.h>
|
||||
#include <winsock2.h>
|
||||
using socklen_t = int;
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include <optional>
|
||||
#include <string.h>
|
||||
#ifdef _WIN32
|
||||
#include <WinSock2.h>
|
||||
#include <iphlpapi.h>
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
typedef SSIZE_T ssize_t;
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "Common/ScopeGuard.h"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "Core/Core.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <climits>
|
||||
#include <dwmapi.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#include "VideoCommon/Present.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <dwmapi.h>
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include <Windows.h>
|
||||
#include <SetupAPI.h>
|
||||
#include <windows.h>
|
||||
#include <setupapi.h>
|
||||
|
||||
namespace ciface::DInput
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace ciface::DInput
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "Common/Event.h"
|
||||
#include "Common/Flag.h"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include <vector>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "InputCommon/ControllerInterface/Win32/Win32.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <cfgmgr32.h>
|
||||
// must be before hidclass
|
||||
#include <initguid.h>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
#include <XInput.h>
|
||||
#include <xinput.h>
|
||||
|
||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include "Common/Version.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <filesystem>
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <windows.h>
|
||||
#include <ShlObj.h>
|
||||
#include <shellapi.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include <filesystem>
|
||||
#include <map>
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <Windows.h>
|
||||
#include <CommCtrl.h>
|
||||
#include <ShObjIdl.h>
|
||||
#include <ShlObj.h>
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <shellapi.h>
|
||||
#include <shlobj.h>
|
||||
#include <shobjidl.h>
|
||||
#include <wrl/client.h>
|
||||
|
||||
#include "Common/Event.h"
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
#include <vector>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "Common/Common.h"
|
||||
|
|
|
|||
|
|
@ -63,6 +63,35 @@ if [ $FORCE -eq 0 ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
SCRIPT_DIR=$(dirname "$0")
|
||||
|
||||
# Generated from "ls *.h -1 > windows-headers.txt" inside mingw-w64/mingw-w64-headers/include.
|
||||
# Get the source here: https://www.mingw-w64.org/source/
|
||||
WINDOWS_HEADERS_FILE="${SCRIPT_DIR}/windows-headers.txt"
|
||||
if [[ ! -f "$WINDOWS_HEADERS_FILE" ]]; then
|
||||
echo >&2 "error: missing windows-headers.txt"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
declare -A WINDOWS_HEADERS_MAP
|
||||
mapfile -t headers < "$WINDOWS_HEADERS_FILE"
|
||||
for header in "${headers[@]}"; do
|
||||
[[ -z "$header" || "$header" =~ ^# ]] && continue
|
||||
WINDOWS_HEADERS_MAP["${header,,}"]=1
|
||||
done
|
||||
|
||||
function windows_include_check() {
|
||||
local file="$1"
|
||||
while read -r header; do
|
||||
local lower="${header,,}"
|
||||
if [[ -n "${WINDOWS_HEADERS_MAP[${lower}]:-}" ]] && [[ "$header" != "${lower}" ]]; then
|
||||
echo "!!! ${file} not compliant to coding style:"
|
||||
echo "Windows system includes must be lowercase: ${header}"
|
||||
fail=1
|
||||
fi
|
||||
done < <(awk -F'[<>]' '/#include </ {print $2}' "$file")
|
||||
}
|
||||
|
||||
did_java_setup=0
|
||||
JAVA_CODESTYLE_FILE="./$($GIT rev-parse --show-cdup)/Source/Android/code-style-java.xml"
|
||||
java_temp_dir=""
|
||||
|
|
@ -125,6 +154,9 @@ for f in ${modified_files}; do
|
|||
fail=1
|
||||
fi
|
||||
|
||||
# Check windows includes are lowercase
|
||||
windows_include_check "${f}"
|
||||
|
||||
# Check for newline at EOF.
|
||||
last_line="$(tail -c 1 ${f})"
|
||||
if [ -n "${last_line}" ]; then
|
||||
|
|
|
|||
1405
Tools/windows-headers.txt
Normal file
1405
Tools/windows-headers.txt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user