mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	Merge pull request #876 from linkmauve/include-cleanups
Cleanup includes, mostly in common
This commit is contained in:
		
						commit
						867c28ae03
					
				
					 108 changed files with 380 additions and 408 deletions
				
			
		| 
						 | 
				
			
			@ -4,6 +4,8 @@
 | 
			
		|||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <string>
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,29 +2,35 @@
 | 
			
		|||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include <cstddef>
 | 
			
		||||
#include <system_error>
 | 
			
		||||
#include <type_traits>
 | 
			
		||||
#include <memory>
 | 
			
		||||
#include <unordered_map>
 | 
			
		||||
#include <utility>
 | 
			
		||||
 | 
			
		||||
#include <boost/container/flat_map.hpp>
 | 
			
		||||
 | 
			
		||||
#include "common/assert.h"
 | 
			
		||||
#include "common/common_types.h"
 | 
			
		||||
#include "common/file_util.h"
 | 
			
		||||
#include "common/logging/log.h"
 | 
			
		||||
#include "common/make_unique.h"
 | 
			
		||||
#include "common/math_util.h"
 | 
			
		||||
 | 
			
		||||
#include "core/file_sys/archive_backend.h"
 | 
			
		||||
#include "core/file_sys/archive_extsavedata.h"
 | 
			
		||||
#include "core/file_sys/archive_romfs.h"
 | 
			
		||||
#include "core/file_sys/archive_savedata.h"
 | 
			
		||||
#include "core/file_sys/archive_savedatacheck.h"
 | 
			
		||||
#include "core/file_sys/archive_sdmc.h"
 | 
			
		||||
#include "core/file_sys/archive_systemsavedata.h"
 | 
			
		||||
#include "core/file_sys/directory_backend.h"
 | 
			
		||||
#include "core/file_sys/file_backend.h"
 | 
			
		||||
#include "core/hle/hle.h"
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
#include "core/hle/service/fs/archive.h"
 | 
			
		||||
#include "core/hle/service/fs/fs_user.h"
 | 
			
		||||
#include "core/hle/result.h"
 | 
			
		||||
#include "core/memory.h"
 | 
			
		||||
 | 
			
		||||
// Specializes std::hash for ArchiveIdCode, so that we can use it in std::unordered_map.
 | 
			
		||||
// Workaroung for libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,22 +4,25 @@
 | 
			
		|||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <memory>
 | 
			
		||||
#include <string>
 | 
			
		||||
 | 
			
		||||
#include "common/common_types.h"
 | 
			
		||||
 | 
			
		||||
#include "core/file_sys/archive_backend.h"
 | 
			
		||||
#include "core/hle/kernel/kernel.h"
 | 
			
		||||
#include "core/hle/kernel/session.h"
 | 
			
		||||
#include "core/hle/result.h"
 | 
			
		||||
 | 
			
		||||
namespace FileSys {
 | 
			
		||||
class DirectoryBackend;
 | 
			
		||||
class FileBackend;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// The unique system identifier hash, also known as ID0
 | 
			
		||||
extern const std::string SYSTEM_ID;
 | 
			
		||||
/// The scrambled SD card CID, also known as ID1
 | 
			
		||||
extern const std::string SDCARD_ID;
 | 
			
		||||
 | 
			
		||||
namespace Kernel {
 | 
			
		||||
    class Session;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace FS {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,14 +9,16 @@
 | 
			
		|||
#include "core/hle/kernel/event.h"
 | 
			
		||||
#include "core/hle/kernel/shared_memory.h"
 | 
			
		||||
#include "core/hle/result.h"
 | 
			
		||||
#include "gsp_gpu.h"
 | 
			
		||||
#include "core/hw/hw.h"
 | 
			
		||||
#include "core/hw/gpu.h"
 | 
			
		||||
#include "core/hw/lcd.h"
 | 
			
		||||
 | 
			
		||||
#include "video_core/gpu_debugger.h"
 | 
			
		||||
#include "video_core/renderer_base.h"
 | 
			
		||||
#include "video_core/video_core.h"
 | 
			
		||||
 | 
			
		||||
#include "gsp_gpu.h"
 | 
			
		||||
 | 
			
		||||
// Main graphics debugger object - TODO: Here is probably not the best place for this
 | 
			
		||||
GraphicsDebugger g_debugger;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,8 +5,11 @@
 | 
			
		|||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <cstddef>
 | 
			
		||||
#include <string>
 | 
			
		||||
 | 
			
		||||
#include "common/bit_field.h"
 | 
			
		||||
#include "common/common_types.h"
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,7 @@
 | 
			
		|||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "common/logging/log.h"
 | 
			
		||||
#include "common/emu_window.h"
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
#include "core/hle/service/hid/hid.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,16 +6,18 @@
 | 
			
		|||
 | 
			
		||||
#include <array>
 | 
			
		||||
 | 
			
		||||
#include "core/hle/kernel/kernel.h"
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
#include "common/bit_field.h"
 | 
			
		||||
#ifndef _MSC_VER
 | 
			
		||||
#include <cstddef>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
namespace Kernel {
 | 
			
		||||
    class SharedMemory;
 | 
			
		||||
    class Event;
 | 
			
		||||
}
 | 
			
		||||
#include "common/bit_field.h"
 | 
			
		||||
#include "common/common_funcs.h"
 | 
			
		||||
#include "common/common_types.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
 | 
			
		||||
class Interface;
 | 
			
		||||
 | 
			
		||||
namespace HID {
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,7 @@
 | 
			
		|||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <cstddef>
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <unordered_map>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -11,8 +12,8 @@
 | 
			
		|||
 | 
			
		||||
#include "common/common_types.h"
 | 
			
		||||
 | 
			
		||||
#include "core/hle/kernel/kernel.h"
 | 
			
		||||
#include "core/hle/kernel/session.h"
 | 
			
		||||
#include "core/hle/result.h"
 | 
			
		||||
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
// Namespace Service
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,40 +2,47 @@
 | 
			
		|||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "common/logging/log.h"
 | 
			
		||||
#include "common/platform.h"
 | 
			
		||||
 | 
			
		||||
#if EMU_PLATFORM == PLATFORM_WINDOWS
 | 
			
		||||
#include <winsock2.h>
 | 
			
		||||
#include <ws2tcpip.h>
 | 
			
		||||
 | 
			
		||||
// MinGW does not define several errno constants
 | 
			
		||||
#ifndef _MSC_VER
 | 
			
		||||
#define EBADMSG 104
 | 
			
		||||
#define ENODATA 120
 | 
			
		||||
#define ENOMSG  122
 | 
			
		||||
#define ENOSR   124
 | 
			
		||||
#define ENOSTR  125
 | 
			
		||||
#define ETIME   137
 | 
			
		||||
#define EIDRM   2001
 | 
			
		||||
#define ENOLINK 2002
 | 
			
		||||
#endif // _MSC_VER
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <netdb.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
#include <poll.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "common/scope_exit.h"
 | 
			
		||||
#include "core/hle/hle.h"
 | 
			
		||||
#include "core/hle/service/soc_u.h"
 | 
			
		||||
#include <algorithm>
 | 
			
		||||
#include <cstring>
 | 
			
		||||
#include <unordered_map>
 | 
			
		||||
 | 
			
		||||
#if EMU_PLATFORM == PLATFORM_WINDOWS
 | 
			
		||||
#include "common/assert.h"
 | 
			
		||||
#include "common/bit_field.h"
 | 
			
		||||
#include "common/common_types.h"
 | 
			
		||||
#include "common/logging/log.h"
 | 
			
		||||
#include "common/scope_exit.h"
 | 
			
		||||
 | 
			
		||||
#include "core/hle/kernel/session.h"
 | 
			
		||||
#include "core/hle/result.h"
 | 
			
		||||
#include "core/hle/service/soc_u.h"
 | 
			
		||||
#include "core/memory.h"
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
    #include <winsock2.h>
 | 
			
		||||
    #include <ws2tcpip.h>
 | 
			
		||||
 | 
			
		||||
    // MinGW does not define several errno constants
 | 
			
		||||
    #ifndef _MSC_VER
 | 
			
		||||
        #define EBADMSG 104
 | 
			
		||||
        #define ENODATA 120
 | 
			
		||||
        #define ENOMSG  122
 | 
			
		||||
        #define ENOSR   124
 | 
			
		||||
        #define ENOSTR  125
 | 
			
		||||
        #define ETIME   137
 | 
			
		||||
        #define EIDRM   2001
 | 
			
		||||
        #define ENOLINK 2002
 | 
			
		||||
    #endif // _MSC_VER
 | 
			
		||||
#else
 | 
			
		||||
    #include <cerrno>
 | 
			
		||||
    #include <fcntl.h>
 | 
			
		||||
    #include <netinet/in.h>
 | 
			
		||||
    #include <netdb.h>
 | 
			
		||||
    #include <poll.h>
 | 
			
		||||
    #include <sys/socket.h>
 | 
			
		||||
    #include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
#    define WSAEAGAIN      WSAEWOULDBLOCK
 | 
			
		||||
#    define WSAEMULTIHOP   -1 // Invalid dummy value
 | 
			
		||||
#    define ERRNO(x)       WSA##x
 | 
			
		||||
| 
						 | 
				
			
			@ -371,7 +378,7 @@ static void Fcntl(Service::Interface* self) {
 | 
			
		|||
    });
 | 
			
		||||
 | 
			
		||||
    if (ctr_cmd == 3) { // F_GETFL
 | 
			
		||||
#if EMU_PLATFORM == PLATFORM_WINDOWS
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
        posix_ret = 0;
 | 
			
		||||
        auto iter = open_sockets.find(socket_handle);
 | 
			
		||||
        if (iter != open_sockets.end() && iter->second.blocking == false)
 | 
			
		||||
| 
						 | 
				
			
			@ -388,7 +395,7 @@ static void Fcntl(Service::Interface* self) {
 | 
			
		|||
            posix_ret |= 4; // O_NONBLOCK
 | 
			
		||||
#endif
 | 
			
		||||
    } else if (ctr_cmd == 4) { // F_SETFL
 | 
			
		||||
#if EMU_PLATFORM == PLATFORM_WINDOWS
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
        unsigned long tmp = (ctr_arg & 4 /* O_NONBLOCK */) ? 1 : 0;
 | 
			
		||||
        int ret = ioctlsocket(socket_handle, FIONBIO, &tmp);
 | 
			
		||||
        if (ret == SOCKET_ERROR_VALUE) {
 | 
			
		||||
| 
						 | 
				
			
			@ -682,7 +689,7 @@ static void Connect(Service::Interface* self) {
 | 
			
		|||
 | 
			
		||||
static void InitializeSockets(Service::Interface* self) {
 | 
			
		||||
    // TODO(Subv): Implement
 | 
			
		||||
#if EMU_PLATFORM == PLATFORM_WINDOWS
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
    WSADATA data;
 | 
			
		||||
    WSAStartup(MAKEWORD(2, 2), &data);
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -696,7 +703,7 @@ static void ShutdownSockets(Service::Interface* self) {
 | 
			
		|||
    // TODO(Subv): Implement
 | 
			
		||||
    CleanupSockets();
 | 
			
		||||
 | 
			
		||||
#if EMU_PLATFORM == PLATFORM_WINDOWS
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
    WSACleanup();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -747,7 +754,7 @@ Interface::Interface() {
 | 
			
		|||
 | 
			
		||||
Interface::~Interface() {
 | 
			
		||||
    CleanupSockets();
 | 
			
		||||
#if EMU_PLATFORM == PLATFORM_WINDOWS
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
    WSACleanup();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,8 @@
 | 
			
		|||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <string>
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,6 +12,7 @@
 | 
			
		|||
#include "core/hw/y2r.h"
 | 
			
		||||
#include "core/mem_map.h"
 | 
			
		||||
 | 
			
		||||
#include "video_core/renderer_base.h"
 | 
			
		||||
#include "video_core/utils.h"
 | 
			
		||||
#include "video_core/video_core.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,9 +5,11 @@
 | 
			
		|||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <array>
 | 
			
		||||
#include <string>
 | 
			
		||||
 | 
			
		||||
#include "common/common_types.h"
 | 
			
		||||
 | 
			
		||||
#include "core/hle/result.h"
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue