From b2f678b8d14cbc1dd2d2e6cf6c8fd952bc61f9b2 Mon Sep 17 00:00:00 2001 From: GPUCode Date: Sun, 24 Mar 2024 11:54:55 +0200 Subject: [PATCH] code: Nuke savestate support --- CMakeLists.txt | 1 - externals/CMakeLists.txt | 5 - src/audio_core/dsp_interface.h | 6 +- src/audio_core/hle/hle.cpp | 24 - src/audio_core/hle/hle.h | 5 - src/audio_core/hle/mixers.h | 11 - src/audio_core/hle/shared_memory.h | 7 - src/audio_core/hle/source.h | 49 - .../configuration/configure_system.cpp | 4 +- src/citra_qt/main.cpp | 46 +- src/citra_qt/main.h | 6 +- src/common/CMakeLists.txt | 10 +- src/common/archives.h | 21 - src/common/construct.h | 34 - src/common/file_util.cpp | 7 - src/common/file_util.h | 59 - src/common/memory_ref.cpp | 3 - src/common/memory_ref.h | 25 - src/common/serialization/atomic.h | 29 - .../serialization/boost_discrete_interval.hpp | 38 - src/common/serialization/boost_flat_set.h | 38 - .../serialization/boost_interval_set.hpp | 38 - .../serialization/boost_small_vector.hpp | 144 -- .../serialization/boost_std_variant.hpp | 204 --- src/common/serialization/boost_vector.hpp | 149 -- src/common/thread_queue_list.h | 28 - src/common/vector_math.h | 25 - src/core/CMakeLists.txt | 5 +- src/core/arm/arm_interface.h | 116 -- src/core/arm/dynarmic/arm_dynarmic.cpp | 4 - src/core/arm/dynarmic/arm_dynarmic.h | 3 - src/core/arm/dyncom/arm_dyncom.cpp | 4 - src/core/arm/dyncom/arm_dyncom.h | 3 - src/core/core.cpp | 91 +- src/core/core.h | 18 +- src/core/core_timing.cpp | 10 - src/core/core_timing.h | 60 - src/core/file_sys/archive_backend.h | 39 - src/core/file_sys/archive_extsavedata.cpp | 17 +- src/core/file_sys/archive_extsavedata.h | 14 - src/core/file_sys/archive_ncch.cpp | 6 +- src/core/file_sys/archive_ncch.h | 34 - src/core/file_sys/archive_other_savedata.cpp | 5 +- src/core/file_sys/archive_other_savedata.h | 22 - src/core/file_sys/archive_savedata.cpp | 4 +- src/core/file_sys/archive_savedata.h | 12 - src/core/file_sys/archive_sdmc.cpp | 9 +- src/core/file_sys/archive_sdmc.h | 23 - src/core/file_sys/archive_sdmcwriteonly.cpp | 9 +- src/core/file_sys/archive_sdmcwriteonly.h | 20 - src/core/file_sys/archive_selfncch.cpp | 25 +- src/core/file_sys/archive_selfncch.h | 26 - .../file_sys/archive_source_sd_savedata.cpp | 4 +- .../file_sys/archive_source_sd_savedata.h | 11 - src/core/file_sys/archive_systemsavedata.cpp | 4 +- src/core/file_sys/archive_systemsavedata.h | 12 - src/core/file_sys/delay_generator.cpp | 4 +- src/core/file_sys/delay_generator.h | 18 - src/core/file_sys/directory_backend.h | 5 - src/core/file_sys/disk_archive.cpp | 5 +- src/core/file_sys/disk_archive.h | 35 - src/core/file_sys/file_backend.h | 7 - src/core/file_sys/ivfc_archive.cpp | 8 +- src/core/file_sys/ivfc_archive.h | 34 - src/core/file_sys/layered_fs.cpp | 6 +- src/core/file_sys/layered_fs.h | 22 - src/core/file_sys/romfs_reader.cpp | 4 +- src/core/file_sys/romfs_reader.h | 23 - src/core/file_sys/savedata_archive.cpp | 6 - src/core/file_sys/savedata_archive.h | 14 - src/core/global.h | 21 - src/core/hle/kernel/address_arbiter.cpp | 43 +- src/core/hle/kernel/address_arbiter.h | 9 - src/core/hle/kernel/client_port.cpp | 17 +- src/core/hle/kernel/client_port.h | 9 - src/core/hle/kernel/client_session.cpp | 14 - src/core/hle/kernel/client_session.h | 9 - src/core/hle/kernel/config_mem.cpp | 12 +- src/core/hle/kernel/config_mem.h | 7 - src/core/hle/kernel/event.cpp | 15 - src/core/hle/kernel/event.h | 8 - src/core/hle/kernel/handle_table.cpp | 15 +- src/core/hle/kernel/handle_table.h | 8 - src/core/hle/kernel/hle_ipc.cpp | 53 +- src/core/hle/kernel/hle_ipc.h | 57 - src/core/hle/kernel/ipc.cpp | 15 +- src/core/hle/kernel/ipc.h | 8 - src/core/hle/kernel/kernel.cpp | 51 - src/core/hle/kernel/kernel.h | 12 - src/core/hle/kernel/memory.cpp | 36 +- src/core/hle/kernel/memory.h | 18 - src/core/hle/kernel/mutex.cpp | 17 - src/core/hle/kernel/mutex.h | 8 - src/core/hle/kernel/object.cpp | 10 - src/core/hle/kernel/object.h | 18 +- src/core/hle/kernel/process.cpp | 68 +- src/core/hle/kernel/process.h | 27 - src/core/hle/kernel/resource_limit.cpp | 23 - src/core/hle/kernel/resource_limit.h | 15 - src/core/hle/kernel/semaphore.cpp | 15 - src/core/hle/kernel/semaphore.h | 9 - src/core/hle/kernel/server_port.cpp | 17 +- src/core/hle/kernel/server_port.h | 9 - src/core/hle/kernel/server_session.cpp | 19 +- src/core/hle/kernel/server_session.h | 8 - src/core/hle/kernel/session.cpp | 16 +- src/core/hle/kernel/session.h | 8 - src/core/hle/kernel/shared_memory.cpp | 23 - src/core/hle/kernel/shared_memory.h | 8 - src/core/hle/kernel/shared_page.cpp | 25 +- src/core/hle/kernel/shared_page.h | 14 - src/core/hle/kernel/svc.cpp | 21 +- src/core/hle/kernel/svc.h | 4 - src/core/hle/kernel/thread.cpp | 46 +- src/core/hle/kernel/thread.h | 33 - src/core/hle/kernel/timer.cpp | 25 - src/core/hle/kernel/timer.h | 12 - src/core/hle/kernel/vm_manager.cpp | 49 +- src/core/hle/kernel/vm_manager.h | 16 - src/core/hle/kernel/wait_object.cpp | 16 +- src/core/hle/kernel/wait_object.h | 7 - src/core/hle/mii.cpp | 18 +- src/core/hle/mii.h | 13 - src/core/hle/result.h | 8 - src/core/hle/service/ac/ac.cpp | 15 +- src/core/hle/service/ac/ac.h | 7 - src/core/hle/service/ac/ac_i.cpp | 3 - src/core/hle/service/ac/ac_i.h | 6 - src/core/hle/service/ac/ac_u.cpp | 3 - src/core/hle/service/ac/ac_u.h | 6 - src/core/hle/service/act/act.h | 5 - src/core/hle/service/act/act_a.cpp | 3 - src/core/hle/service/act/act_a.h | 6 - src/core/hle/service/act/act_u.cpp | 3 - src/core/hle/service/act/act_u.h | 6 - src/core/hle/service/am/am.cpp | 17 +- src/core/hle/service/am/am.h | 15 +- src/core/hle/service/am/am_app.cpp | 3 - src/core/hle/service/am/am_app.h | 6 - src/core/hle/service/am/am_net.cpp | 3 - src/core/hle/service/am/am_net.h | 6 - src/core/hle/service/am/am_sys.cpp | 3 - src/core/hle/service/am/am_sys.h | 6 - src/core/hle/service/am/am_u.cpp | 3 - src/core/hle/service/am/am_u.h | 6 - src/core/hle/service/apt/applet_manager.cpp | 3 - src/core/hle/service/apt/applet_manager.h | 136 +- src/core/hle/service/apt/apt.cpp | 18 - src/core/hle/service/apt/apt.h | 18 +- src/core/hle/service/apt/apt_a.cpp | 3 - src/core/hle/service/apt/apt_a.h | 6 - src/core/hle/service/apt/apt_s.cpp | 3 - src/core/hle/service/apt/apt_s.h | 6 - src/core/hle/service/apt/apt_u.cpp | 3 - src/core/hle/service/apt/apt_u.h | 6 - src/core/hle/service/apt/ns_c.cpp | 3 - src/core/hle/service/apt/ns_c.h | 6 - src/core/hle/service/apt/ns_s.cpp | 3 - src/core/hle/service/apt/ns_s.h | 6 - src/core/hle/service/boss/boss.cpp | 22 - src/core/hle/service/boss/boss.h | 16 +- src/core/hle/service/boss/boss_p.cpp | 3 - src/core/hle/service/boss/boss_p.h | 6 - src/core/hle/service/boss/boss_u.cpp | 3 - src/core/hle/service/boss/boss_u.h | 6 - src/core/hle/service/boss/online_service.cpp | 19 - src/core/hle/service/boss/online_service.h | 12 +- src/core/hle/service/cam/cam.cpp | 27 +- src/core/hle/service/cam/cam.h | 71 +- src/core/hle/service/cam/cam_c.cpp | 3 - src/core/hle/service/cam/cam_c.h | 6 - src/core/hle/service/cam/cam_q.cpp | 3 - src/core/hle/service/cam/cam_q.h | 5 - src/core/hle/service/cam/cam_s.cpp | 3 - src/core/hle/service/cam/cam_s.h | 6 - src/core/hle/service/cam/cam_u.cpp | 3 - src/core/hle/service/cam/cam_u.h | 6 - src/core/hle/service/cam/y2r_u.cpp | 16 +- src/core/hle/service/cam/y2r_u.h | 60 - src/core/hle/service/cecd/cecd.cpp | 17 +- src/core/hle/service/cecd/cecd.h | 21 - src/core/hle/service/cecd/cecd_ndm.cpp | 3 - src/core/hle/service/cecd/cecd_ndm.h | 6 - src/core/hle/service/cecd/cecd_s.cpp | 3 - src/core/hle/service/cecd/cecd_s.h | 6 - src/core/hle/service/cecd/cecd_u.cpp | 3 - src/core/hle/service/cecd/cecd_u.h | 6 - src/core/hle/service/cfg/cfg.cpp | 16 +- src/core/hle/service/cfg/cfg.h | 7 - src/core/hle/service/cfg/cfg_i.cpp | 3 - src/core/hle/service/cfg/cfg_i.h | 6 - src/core/hle/service/cfg/cfg_nor.cpp | 3 - src/core/hle/service/cfg/cfg_nor.h | 5 - src/core/hle/service/cfg/cfg_s.cpp | 3 - src/core/hle/service/cfg/cfg_s.h | 6 - src/core/hle/service/cfg/cfg_u.cpp | 3 - src/core/hle/service/cfg/cfg_u.h | 6 - src/core/hle/service/csnd/csnd_snd.cpp | 5 +- src/core/hle/service/csnd/csnd_snd.h | 50 - src/core/hle/service/dlp/dlp_clnt.cpp | 3 - src/core/hle/service/dlp/dlp_clnt.h | 5 - src/core/hle/service/dlp/dlp_fkcl.cpp | 3 - src/core/hle/service/dlp/dlp_fkcl.h | 5 - src/core/hle/service/dlp/dlp_srvr.cpp | 3 - src/core/hle/service/dlp/dlp_srvr.h | 4 - src/core/hle/service/dsp/dsp_dsp.cpp | 5 +- src/core/hle/service/dsp/dsp_dsp.h | 17 - src/core/hle/service/err/err_f.cpp | 14 +- src/core/hle/service/err/err_f.h | 9 - src/core/hle/service/frd/frd.cpp | 4 +- src/core/hle/service/frd/frd.h | 26 - src/core/hle/service/frd/frd_a.cpp | 3 - src/core/hle/service/frd/frd_a.h | 6 - src/core/hle/service/frd/frd_u.cpp | 3 - src/core/hle/service/frd/frd_u.h | 6 - src/core/hle/service/fs/archive.h | 10 - src/core/hle/service/fs/directory.cpp | 21 +- src/core/hle/service/fs/directory.h | 13 +- src/core/hle/service/fs/file.cpp | 25 +- src/core/hle/service/fs/file.h | 30 +- src/core/hle/service/fs/fs_user.cpp | 5 - src/core/hle/service/fs/fs_user.h | 21 - src/core/hle/service/gsp/gsp_gpu.cpp | 30 +- src/core/hle/service/gsp/gsp_gpu.h | 14 - src/core/hle/service/gsp/gsp_lcd.cpp | 3 - src/core/hle/service/gsp/gsp_lcd.h | 5 - src/core/hle/service/hid/hid.cpp | 33 +- src/core/hle/service/hid/hid.h | 9 - src/core/hle/service/hid/hid_spvr.cpp | 3 - src/core/hle/service/hid/hid_spvr.h | 6 - src/core/hle/service/hid/hid_user.cpp | 3 - src/core/hle/service/hid/hid_user.h | 6 - src/core/hle/service/http/http_c.cpp | 5 +- src/core/hle/service/http/http_c.h | 113 -- src/core/hle/service/ir/extra_hid.h | 13 - src/core/hle/service/ir/ir_rst.cpp | 18 - src/core/hle/service/ir/ir_rst.h | 7 - src/core/hle/service/ir/ir_u.cpp | 3 - src/core/hle/service/ir/ir_u.h | 5 - src/core/hle/service/ir/ir_user.cpp | 44 +- src/core/hle/service/ir/ir_user.h | 8 - src/core/hle/service/ldr_ro/ldr_ro.cpp | 6 +- src/core/hle/service/ldr_ro/ldr_ro.h | 20 - src/core/hle/service/mcu/mcu_hwc.cpp | 3 - src/core/hle/service/mcu/mcu_hwc.h | 5 - src/core/hle/service/mic/mic_u.cpp | 58 +- src/core/hle/service/mic/mic_u.h | 9 - src/core/hle/service/mvd/mvd_std.cpp | 3 - src/core/hle/service/mvd/mvd_std.h | 5 - src/core/hle/service/ndm/ndm_u.cpp | 3 - src/core/hle/service/ndm/ndm_u.h | 16 - src/core/hle/service/news/news.cpp | 13 +- src/core/hle/service/news/news.h | 42 - src/core/hle/service/news/news_s.cpp | 3 - src/core/hle/service/news/news_s.h | 6 - src/core/hle/service/news/news_u.cpp | 3 - src/core/hle/service/news/news_u.h | 6 - src/core/hle/service/nfc/nfc.cpp | 11 - src/core/hle/service/nfc/nfc.h | 8 - src/core/hle/service/nfc/nfc_device.cpp | 21 - src/core/hle/service/nfc/nfc_device.h | 7 - src/core/hle/service/nfc/nfc_m.cpp | 3 - src/core/hle/service/nfc/nfc_m.h | 6 - src/core/hle/service/nfc/nfc_types.h | 26 - src/core/hle/service/nfc/nfc_u.cpp | 3 - src/core/hle/service/nfc/nfc_u.h | 6 - src/core/hle/service/nim/nim_aoc.cpp | 3 - src/core/hle/service/nim/nim_aoc.h | 7 +- src/core/hle/service/nim/nim_s.cpp | 3 - src/core/hle/service/nim/nim_s.h | 5 - src/core/hle/service/nim/nim_u.cpp | 4 - src/core/hle/service/nim/nim_u.h | 12 - src/core/hle/service/nwm/nwm_cec.cpp | 3 - src/core/hle/service/nwm/nwm_cec.h | 5 - src/core/hle/service/nwm/nwm_ext.cpp | 3 - src/core/hle/service/nwm/nwm_ext.h | 5 - src/core/hle/service/nwm/nwm_inf.cpp | 3 - src/core/hle/service/nwm/nwm_inf.h | 5 - src/core/hle/service/nwm/nwm_sap.cpp | 3 - src/core/hle/service/nwm/nwm_sap.h | 5 - src/core/hle/service/nwm/nwm_soc.cpp | 3 - src/core/hle/service/nwm/nwm_soc.h | 5 - src/core/hle/service/nwm/nwm_tst.cpp | 3 - src/core/hle/service/nwm/nwm_tst.h | 5 - src/core/hle/service/nwm/nwm_uds.cpp | 26 +- src/core/hle/service/nwm/nwm_uds.h | 17 - src/core/hle/service/plgldr/plgldr.cpp | 33 +- src/core/hle/service/plgldr/plgldr.h | 22 - src/core/hle/service/pm/pm_app.cpp | 3 - src/core/hle/service/pm/pm_app.h | 5 - src/core/hle/service/pm/pm_dbg.cpp | 3 - src/core/hle/service/pm/pm_dbg.h | 5 - src/core/hle/service/ps/ps_ps.cpp | 4 +- src/core/hle/service/ps/ps_ps.h | 4 - src/core/hle/service/ptm/ptm.cpp | 12 - src/core/hle/service/ptm/ptm.h | 7 - src/core/hle/service/ptm/ptm_gets.cpp | 3 - src/core/hle/service/ptm/ptm_gets.h | 6 - src/core/hle/service/ptm/ptm_play.cpp | 3 - src/core/hle/service/ptm/ptm_play.h | 6 - src/core/hle/service/ptm/ptm_sets.cpp | 3 - src/core/hle/service/ptm/ptm_sets.h | 8 +- src/core/hle/service/ptm/ptm_sysm.cpp | 4 - src/core/hle/service/ptm/ptm_sysm.h | 11 - src/core/hle/service/ptm/ptm_u.cpp | 3 - src/core/hle/service/ptm/ptm_u.h | 6 - src/core/hle/service/pxi/dev.cpp | 3 - src/core/hle/service/pxi/dev.h | 5 - src/core/hle/service/qtm/qtm_c.cpp | 3 - src/core/hle/service/qtm/qtm_c.h | 5 - src/core/hle/service/qtm/qtm_s.cpp | 3 - src/core/hle/service/qtm/qtm_s.h | 4 - src/core/hle/service/qtm/qtm_sp.cpp | 3 - src/core/hle/service/qtm/qtm_sp.h | 5 - src/core/hle/service/qtm/qtm_u.cpp | 3 - src/core/hle/service/qtm/qtm_u.h | 5 - src/core/hle/service/service.h | 45 - src/core/hle/service/sm/sm.h | 22 - src/core/hle/service/sm/srv.cpp | 26 +- src/core/hle/service/sm/srv.h | 9 - src/core/hle/service/soc/soc_u.cpp | 4 +- src/core/hle/service/soc/soc_u.h | 22 - src/core/hle/service/ssl/ssl_c.cpp | 3 +- src/core/hle/service/ssl/ssl_c.h | 4 - src/core/memory.cpp | 59 +- src/core/memory.h | 22 - src/core/movie.cpp | 69 +- src/core/movie.h | 7 - src/core/savestate.cpp | 208 --- src/core/savestate.h | 27 - src/core/savestate_data.h | 1427 ----------------- src/network/CMakeLists.txt | 2 +- src/network/room_member.h | 12 - src/video_core/CMakeLists.txt | 2 +- src/video_core/gpu.cpp | 8 - src/video_core/gpu.h | 5 - src/video_core/pica/geometry_pipeline.cpp | 128 +- src/video_core/pica/geometry_pipeline.h | 10 - src/video_core/pica/output_vertex.h | 14 - src/video_core/pica/packed_attribute.h | 10 - src/video_core/pica/pica_core.cpp | 15 +- src/video_core/pica/pica_core.h | 60 - src/video_core/pica/primitive_assembly.h | 12 - src/video_core/pica/regs_lcd.h | 12 - src/video_core/pica/shader_setup.h | 22 - src/video_core/pica/shader_unit.h | 31 - src/video_core/pica_types.h | 7 - 347 files changed, 120 insertions(+), 7064 deletions(-) delete mode 100644 src/common/archives.h delete mode 100644 src/common/construct.h delete mode 100644 src/common/serialization/atomic.h delete mode 100644 src/common/serialization/boost_discrete_interval.hpp delete mode 100644 src/common/serialization/boost_flat_set.h delete mode 100644 src/common/serialization/boost_interval_set.hpp delete mode 100644 src/common/serialization/boost_small_vector.hpp delete mode 100644 src/common/serialization/boost_std_variant.hpp delete mode 100644 src/common/serialization/boost_vector.hpp delete mode 100644 src/core/global.h delete mode 100644 src/core/savestate.cpp delete mode 100644 src/core/savestate.h delete mode 100644 src/core/savestate_data.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 87a485e5d4..d8ab1dd979 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -404,7 +404,6 @@ add_subdirectory(externals) if (NOT USE_SYSTEM_BOOST) add_definitions( -DBOOST_ALL_NO_LIB ) add_library(Boost::boost ALIAS boost) - add_library(Boost::serialization ALIAS boost_serialization) add_library(Boost::iostreams ALIAS boost_iostreams) endif() diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index fc45473b6b..bae3583660 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -20,11 +20,6 @@ if (NOT USE_SYSTEM_BOOST) add_library(boost INTERFACE) target_include_directories(boost SYSTEM INTERFACE ${Boost_INCLUDE_DIR}) - # Boost::serialization - file(GLOB boost_serialization_SRC "${CMAKE_SOURCE_DIR}/externals/boost/libs/serialization/src/*.cpp") - add_library(boost_serialization STATIC ${boost_serialization_SRC}) - target_link_libraries(boost_serialization PUBLIC boost) - # Boost::iostreams add_library( boost_iostreams diff --git a/src/audio_core/dsp_interface.h b/src/audio_core/dsp_interface.h index e2e76db6df..e49a0cd8c0 100644 --- a/src/audio_core/dsp_interface.h +++ b/src/audio_core/dsp_interface.h @@ -4,9 +4,9 @@ #pragma once +#include #include #include -#include #include "audio_core/audio_types.h" #include "audio_core/time_stretch.h" #include "common/common_types.h" @@ -123,10 +123,6 @@ class DspInterface { std::array last_frame{}; TimeStretcher time_stretcher; std::unique_ptr sink; - - template - void serialize(Archive& ar, const unsigned int) {} - friend class boost::serialization::access; }; } // namespace AudioCore diff --git a/src/audio_core/hle/hle.cpp b/src/audio_core/hle/hle.cpp index 9d52775041..d21de3b233 100644 --- a/src/audio_core/hle/hle.cpp +++ b/src/audio_core/hle/hle.cpp @@ -2,11 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include -#include -#include -#include -#include #include "audio_core/audio_types.h" #include "audio_core/hle/aac_decoder.h" #include "audio_core/hle/common.h" @@ -16,7 +11,6 @@ #include "audio_core/hle/shared_memory.h" #include "audio_core/hle/source.h" #include "audio_core/sink.h" -#include "common/archives.h" #include "common/assert.h" #include "common/common_types.h" #include "common/hash.h" @@ -30,13 +24,6 @@ namespace AudioCore { DspHle::DspHle(Core::System& system) : DspHle(system, system.Memory(), system.CoreTiming()) {} -template -void DspHle::serialize(Archive& ar, const unsigned int) { - ar& boost::serialization::base_object(*this); - ar&* impl.get(); -} -SERIALIZE_IMPL(DspHle) - // The value below is the "perfect" mathematical ratio of ARM11 cycles per audio frame, samples per // frame * teaklite cycles per sample * 2 ARM11 cycles/teaklite cycle // (160 * 4096 * 2) = (1310720) @@ -95,17 +82,6 @@ struct DspHle::Impl final { std::unique_ptr aac_decoder{}; std::function interrupt_handler{}; - - template - void serialize(Archive& ar, const unsigned int) { - ar& dsp_state; - ar& pipe_data; - ar& dsp_memory.raw_memory; - ar& sources; - ar& mixers; - // interrupt_handler is reregistered when loading state from DSP_DSP - } - friend class boost::serialization::access; }; DspHle::Impl::Impl(DspHle& parent_, Memory::MemorySystem& memory, Core::Timing& timing) diff --git a/src/audio_core/hle/hle.h b/src/audio_core/hle/hle.h index 2ee4421e74..f66f1a5909 100644 --- a/src/audio_core/hle/hle.h +++ b/src/audio_core/hle/hle.h @@ -7,7 +7,6 @@ #include #include #include -#include #include "audio_core/audio_types.h" #include "audio_core/dsp_interface.h" #include "common/common_types.h" @@ -49,10 +48,6 @@ class DspHle final : public DspInterface { struct Impl; friend struct Impl; std::unique_ptr impl; - - template - void serialize(Archive& ar, const unsigned int); - friend class boost::serialization::access; }; } // namespace AudioCore diff --git a/src/audio_core/hle/mixers.h b/src/audio_core/hle/mixers.h index 9fecfcbe2b..1831a7b506 100644 --- a/src/audio_core/hle/mixers.h +++ b/src/audio_core/hle/mixers.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include "audio_core/audio_types.h" #include "audio_core/hle/shared_memory.h" @@ -54,16 +53,6 @@ class Mixers final { void DownmixAndMixIntoCurrentFrame(float gain, const QuadFrame32& samples); /// INTERNAL: Generate DspStatus based on internal state. DspStatus GetCurrentStatus() const; - - template - void serialize(Archive& ar, const unsigned int) { - ar& current_frame; - ar& state.intermediate_mixer_volume; - ar& state.aux_bus_enable; - ar& state.intermediate_mix_buffer; - ar& state.output_format; - } - friend class boost::serialization::access; }; } // namespace AudioCore::HLE diff --git a/src/audio_core/hle/shared_memory.h b/src/audio_core/hle/shared_memory.h index dfa9d2da1b..c9974c60dc 100644 --- a/src/audio_core/hle/shared_memory.h +++ b/src/audio_core/hle/shared_memory.h @@ -8,7 +8,6 @@ #include #include #include -#include #include "audio_core/audio_types.h" #include "audio_core/hle/common.h" #include "common/bit_field.h" @@ -57,12 +56,6 @@ struct u32_dsp { return (value << 16) | (value >> 16); } u32_le storage; - - template - void serialize(Archive& ar, const unsigned int) { - ar& storage; - } - friend class boost::serialization::access; }; static_assert(std::is_trivially_copyable::value, "u32_dsp isn't trivially copyable"); diff --git a/src/audio_core/hle/source.h b/src/audio_core/hle/source.h index d7114952b6..523e6d9bb0 100644 --- a/src/audio_core/hle/source.h +++ b/src/audio_core/hle/source.h @@ -6,10 +6,6 @@ #include #include -#include -#include -#include -#include #include #include "audio_core/audio_types.h" #include "audio_core/codec.h" @@ -89,24 +85,6 @@ class Source final { bool from_queue; u32 play_position; // = 0; bool has_played; // = false; - - private: - template - void serialize(Archive& ar, const unsigned int) { - ar& physical_address; - ar& length; - ar& adpcm_ps; - ar& adpcm_yn; - ar& adpcm_dirty; - ar& is_looping; - ar& buffer_id; - ar& mono_or_stereo; - ar& format; - ar& from_queue; - ar& play_position; - ar& has_played; - } - friend class boost::serialization::access; }; struct BufferOrder { @@ -159,27 +137,6 @@ class Source final { // Filter state SourceFilters filters = {}; - - private: - template - void serialize(Archive& ar, const unsigned int) { - ar& enabled; - ar& sync_count; - ar& gain; - ar& input_queue; - ar& mono_or_stereo; - ar& format; - ar& current_sample_number; - ar& current_buffer_physical_address; - ar& current_buffer; - ar& buffer_update; - ar& current_buffer_id; - ar& adpcm_coeffs; - ar& rate_multiplier; - ar& interpolation_mode; - } - friend class boost::serialization::access; - } state; // Internal functions @@ -193,12 +150,6 @@ class Source final { bool DequeueBuffer(); /// INTERNAL: Generates a SourceStatus::Status based on our internal state. SourceStatus::Status GetCurrentStatus(); - - template - void serialize(Archive& ar, const unsigned int) { - ar& state; - } - friend class boost::serialization::access; }; } // namespace AudioCore::HLE diff --git a/src/citra_qt/configuration/configure_system.cpp b/src/citra_qt/configuration/configure_system.cpp index 971f9f5206..239a8c2fae 100644 --- a/src/citra_qt/configuration/configure_system.cpp +++ b/src/citra_qt/configuration/configure_system.cpp @@ -684,8 +684,8 @@ void ConfigureSystem::DownloadFromNUS() { &QProgressDialog::setValue); auto failed = false; - const auto download_title = [&future_watcher, &failed](const u64& title_id) { - if (Service::AM::InstallFromNus(title_id) != Service::AM::InstallStatus::Success) { + const auto download_title = [&future_watcher, &failed, this](const u64& title_id) { + if (Service::AM::InstallFromNus(system, title_id) != Service::AM::InstallStatus::Success) { failed = true; future_watcher.cancel(); } diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 5d8b4204be..c001f56bfd 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include #include @@ -81,7 +80,6 @@ #endif #include "common/settings.h" #include "core/core.h" -#include "core/dumping/backend.h" #include "core/file_sys/archive_extsavedata.h" #include "core/file_sys/archive_source_sd_savedata.h" #include "core/frontend/applets/default_applets.h" @@ -90,7 +88,6 @@ #include "core/hle/service/nfc/nfc.h" #include "core/loader/loader.h" #include "core/movie.h" -#include "core/savestate.h" #include "core/system_titles.h" #include "input_common/main.h" #include "network/network_settings.h" @@ -581,7 +578,7 @@ void GMainWindow::InitializeRecentFileMenuActions() { } void GMainWindow::InitializeSaveStateMenuActions() { - for (u32 i = 0; i < Core::SaveStateSlotCount; ++i) { + for (u32 i = 0; i < SaveStateSlotCount; ++i) { actions_load_state[i] = new QAction(this); actions_load_state[i]->setData(i + 1); connect(actions_load_state[i], &QAction::triggered, this, &GMainWindow::OnLoadState); @@ -1523,47 +1520,6 @@ void GMainWindow::UpdateSaveStates() { if (system.GetAppLoader().ReadProgramId(title_id) != Loader::ResultStatus::Success) { return; } - auto savestates = Core::ListSaveStates(title_id, movie.GetCurrentMovieID()); - for (u32 i = 0; i < Core::SaveStateSlotCount; ++i) { - actions_load_state[i]->setEnabled(false); - actions_load_state[i]->setText(tr("Slot %1").arg(i + 1)); - actions_save_state[i]->setText(tr("Slot %1").arg(i + 1)); - } - for (const auto& savestate : savestates) { - const bool display_name = - savestate.status == Core::SaveStateInfo::ValidationStatus::RevisionDismatch && - !savestate.build_name.empty(); - const auto text = - tr("Slot %1 - %2 %3") - .arg(savestate.slot) - .arg(QDateTime::fromSecsSinceEpoch(savestate.time) - .toString(QStringLiteral("yyyy-MM-dd hh:mm:ss"))) - .arg(display_name ? QString::fromStdString(savestate.build_name) : QLatin1String()) - .trimmed(); - - actions_load_state[savestate.slot - 1]->setEnabled(true); - actions_load_state[savestate.slot - 1]->setText(text); - actions_save_state[savestate.slot - 1]->setText(text); - - ui->action_Load_from_Newest_Slot->setEnabled(true); - - if (savestate.time > newest_slot_time) { - newest_slot = savestate.slot; - newest_slot_time = savestate.time; - } - if (savestate.time < oldest_slot_time) { - oldest_slot = savestate.slot; - oldest_slot_time = savestate.time; - } - } - for (u32 i = 0; i < Core::SaveStateSlotCount; ++i) { - if (!actions_load_state[i]->isEnabled()) { - // Prefer empty slot - oldest_slot = i + 1; - oldest_slot_time = 0; - break; - } - } } void GMainWindow::OnGameListLoadFile(QString game_path) { diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index b64bf1b32d..2e72c39caa 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -15,7 +15,6 @@ #include "citra_qt/compatibility_list.h" #include "citra_qt/hotkeys.h" #include "core/core.h" -#include "core/savestate.h" #ifdef __unix__ #include @@ -367,8 +366,9 @@ private slots: bool defer_update_prompt = false; QAction* actions_recent_files[max_recent_files_item]; - std::array actions_load_state; - std::array actions_save_state; + static constexpr size_t SaveStateSlotCount = 8; + std::array actions_load_state; + std::array actions_save_state; u32 oldest_slot; u64 oldest_slot_time; diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index f8c953a603..16c4e6334e 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -62,7 +62,6 @@ add_library(citra_common STATIC android_storage.cpp announce_multiplayer_room.h arch.h - archives.h assert.h atomic_ops.h detached_tasks.cpp @@ -77,7 +76,6 @@ add_library(citra_common STATIC common_paths.h common_precompiled_headers.h common_types.h - construct.h dynamic_library/dynamic_library.cpp dynamic_library/dynamic_library.h dynamic_library/ffmpeg.cpp @@ -119,12 +117,6 @@ add_library(citra_common STATIC settings.cpp settings.h slot_vector.h - serialization/atomic.h - serialization/boost_discrete_interval.hpp - serialization/boost_flat_set.h - serialization/boost_small_vector.hpp - serialization/boost_std_variant.hpp - serialization/boost_vector.hpp static_lru_cache.h string_literal.h string_util.cpp @@ -184,7 +176,7 @@ endif() create_target_directory_groups(citra_common) -target_link_libraries(citra_common PUBLIC fmt library-headers microprofile Boost::boost Boost::serialization Boost::iostreams) +target_link_libraries(citra_common PUBLIC fmt library-headers microprofile Boost::iostreams) target_link_libraries(citra_common PRIVATE zstd) if ("x86_64" IN_LIST ARCHITECTURE) diff --git a/src/common/archives.h b/src/common/archives.h deleted file mode 100644 index b9f4330bde..0000000000 --- a/src/common/archives.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include -#include - -using iarchive = boost::archive::binary_iarchive; -using oarchive = boost::archive::binary_oarchive; - -#define SERIALIZE_IMPL(A) \ - template void A::serialize(iarchive & ar, const unsigned int file_version); \ - template void A::serialize(oarchive & ar, const unsigned int file_version); - -#define SERIALIZE_EXPORT_IMPL(A) \ - BOOST_CLASS_EXPORT_IMPLEMENT(A) \ - BOOST_SERIALIZATION_REGISTER_ARCHIVE(iarchive) \ - BOOST_SERIALIZATION_REGISTER_ARCHIVE(oarchive) diff --git a/src/common/construct.h b/src/common/construct.h deleted file mode 100644 index cb47bb46ea..0000000000 --- a/src/common/construct.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include - -/// Allows classes to define `save_construct` and `load_construct` methods for serialization -/// This is used where we don't call the default constructor during deserialization, as a shortcut -/// instead of using load_construct_data directly -class construct_access { -public: - template - static void save_construct(Archive& ar, const T* t, const unsigned int file_version) { - t->save_construct(ar, file_version); - } - template - static void load_construct(Archive& ar, T* t, const unsigned int file_version) { - T::load_construct(ar, t, file_version); - } -}; - -#define BOOST_SERIALIZATION_CONSTRUCT(T) \ - namespace boost::serialization { \ - template \ - void save_construct_data(Archive& ar, const T* t, const unsigned int file_version) { \ - construct_access::save_construct(ar, t, file_version); \ - } \ - template \ - void load_construct_data(Archive& ar, T* t, const unsigned int file_version) { \ - construct_access::load_construct(ar, t, file_version); \ - } \ - } diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index cda752e5f0..0e39e01520 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -849,13 +849,6 @@ bool StringReplace(std::string& haystack, const std::string& a, const std::strin return true; } -std::string SerializePath(const std::string& input, bool is_saving) { - auto result = input; - StringReplace(result, "%CITRA_ROM_FILE%", g_currentRomPath, is_saving); - StringReplace(result, "%CITRA_USER_DIR%", GetUserPath(UserPath::UserDir), is_saving); - return result; -} - const std::string& GetUserPath(UserPath path) { // Set up all paths and files on the first run if (g_paths.empty()) diff --git a/src/common/file_util.h b/src/common/file_util.h index 6595fead90..ca13369f70 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -14,9 +14,6 @@ #include #include #include -#include -#include -#include #include "common/common_types.h" #ifdef _MSC_VER #include "common/string_util.h" @@ -42,34 +39,6 @@ enum class UserPath { UserDir, }; -// Replaces install-specific paths with standard placeholders, and back again -std::string SerializePath(const std::string& input, bool is_saving); - -// A serializable path string -struct Path : public boost::serialization::wrapper_traits { - std::string& str; - - explicit Path(std::string& _str) : str(_str) {} - - static const Path make(std::string& str) { - return Path(str); - } - - template - void save(Archive& ar, const unsigned int) const { - auto s_path = SerializePath(str, true); - ar << s_path; - } - template - void load(Archive& ar, const unsigned int) const { - ar >> str; - str = SerializePath(str, false); - } - - BOOST_SERIALIZATION_SPLIT_MEMBER(); - friend class boost::serialization::access; -}; - // FileSystem tree node/ struct FSTEntry { bool isDirectory; @@ -77,17 +46,6 @@ struct FSTEntry { std::string physicalName; // name on disk std::string virtualName; // name in FST names table std::vector children; - -private: - template - void serialize(Archive& ar, const unsigned int) { - ar& isDirectory; - ar& size; - ar& Path::make(physicalName); - ar& Path::make(virtualName); - ar& children; - } - friend class boost::serialization::access; }; // Returns true if file filename exists @@ -391,23 +349,6 @@ class IOFile : public NonCopyable { std::string filename; std::string openmode; u32 flags; - - template - void serialize(Archive& ar, const unsigned int) { - ar& Path::make(filename); - ar& openmode; - ar& flags; - u64 pos; - if (Archive::is_saving::value) { - pos = Tell(); - } - ar& pos; - if (Archive::is_loading::value) { - Open(); - Seek(pos, SEEK_SET); - } - } - friend class boost::serialization::access; }; template diff --git a/src/common/memory_ref.cpp b/src/common/memory_ref.cpp index 300f87d581..7f88e2b8d3 100644 --- a/src/common/memory_ref.cpp +++ b/src/common/memory_ref.cpp @@ -2,7 +2,4 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/archives.h" #include "common/memory_ref.h" - -SERIALIZE_EXPORT_IMPL(BufferMem) diff --git a/src/common/memory_ref.h b/src/common/memory_ref.h index 389528f158..29eb7c96ae 100644 --- a/src/common/memory_ref.h +++ b/src/common/memory_ref.h @@ -7,9 +7,6 @@ #include #include #include -#include -#include -#include #include "common/assert.h" #include "common/common_types.h" @@ -20,11 +17,6 @@ class BackingMem { virtual u8* GetPtr() = 0; virtual const u8* GetPtr() const = 0; virtual std::size_t GetSize() const = 0; - -private: - template - void serialize(Archive&, const unsigned int) {} - friend class boost::serialization::access; }; /// Backing memory implemented by a local buffer @@ -55,17 +47,8 @@ class BufferMem : public BackingMem { private: std::vector data; - - template - void serialize(Archive& ar, const unsigned int) { - ar& boost::serialization::base_object(*this); - ar& data; - } - friend class boost::serialization::access; }; -BOOST_CLASS_EXPORT_KEY(BufferMem); - /** * A managed reference to host-side memory. * Fast enough to be used everywhere instead of u8* @@ -148,12 +131,4 @@ class MemoryRef { csize = 0; } } - - template - void serialize(Archive& ar, const unsigned int) { - ar& backing_mem; - ar& offset; - Init(); - } - friend class boost::serialization::access; }; diff --git a/src/common/serialization/atomic.h b/src/common/serialization/atomic.h deleted file mode 100644 index 0cf0f20bc4..0000000000 --- a/src/common/serialization/atomic.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include - -namespace boost::serialization { - -template -void serialize(Archive& ar, std::atomic& value, const unsigned int file_version) { - boost::serialization::split_free(ar, value, file_version); -} - -template -void save(Archive& ar, const std::atomic& value, const unsigned int file_version) { - ar << value.load(); -} - -template -void load(Archive& ar, std::atomic& value, const unsigned int file_version) { - T tmp; - ar >> tmp; - value.store(tmp); -} - -} // namespace boost::serialization diff --git a/src/common/serialization/boost_discrete_interval.hpp b/src/common/serialization/boost_discrete_interval.hpp deleted file mode 100644 index f04e3cabc6..0000000000 --- a/src/common/serialization/boost_discrete_interval.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include "common/common_types.h" -#include "common/logging/log.h" - -namespace boost::serialization { - -template -void save(Archive& ar, const boost::icl::discrete_interval& obj, - const unsigned int file_version) { - ar << obj.lower(); - ar << obj.upper(); - ar << obj.bounds()._bits; -} - -template -void load(Archive& ar, boost::icl::discrete_interval& obj, - const unsigned int file_version) { - DomainT upper, lower; - boost::icl::bound_type bounds; - ar >> lower; - ar >> upper; - ar >> bounds; - obj = boost::icl::discrete_interval(lower, upper, boost::icl::interval_bounds(bounds)); -} - -template -void serialize(Archive& ar, boost::icl::discrete_interval& obj, - const unsigned int file_version) { - boost::serialization::split_free(ar, obj, file_version); -} - -} // namespace boost::serialization diff --git a/src/common/serialization/boost_flat_set.h b/src/common/serialization/boost_flat_set.h deleted file mode 100644 index 703bd28b3d..0000000000 --- a/src/common/serialization/boost_flat_set.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include -#include "common/common_types.h" - -namespace boost::serialization { - -template -void save(Archive& ar, const boost::container::flat_set& set, const unsigned int file_version) { - ar << static_cast(set.size()); - for (auto& v : set) { - ar << v; - } -} - -template -void load(Archive& ar, boost::container::flat_set& set, const unsigned int file_version) { - u64 count{}; - ar >> count; - set.clear(); - for (u64 i = 0; i < count; i++) { - T value{}; - ar >> value; - set.insert(value); - } -} - -template -void serialize(Archive& ar, boost::container::flat_set& set, const unsigned int file_version) { - boost::serialization::split_free(ar, set, file_version); -} - -} // namespace boost::serialization diff --git a/src/common/serialization/boost_interval_set.hpp b/src/common/serialization/boost_interval_set.hpp deleted file mode 100644 index 73a5603609..0000000000 --- a/src/common/serialization/boost_interval_set.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include -#include "common/serialization/boost_discrete_interval.hpp" - -namespace boost::serialization { - -template -void save(Archive& ar, const boost::icl::interval_set& set, const unsigned int file_version) { - ar << static_cast(set.iterative_size()); - for (auto& v : set) { - ar << v; - } -} - -template -void load(Archive& ar, boost::icl::interval_set& set, const unsigned int file_version) { - u64 count{}; - ar >> count; - set.clear(); - for (u64 i = 0; i < count; i++) { - typename boost::icl::interval_set::interval_type value{}; - ar >> value; - set += value; - } -} - -template -void serialize(Archive& ar, boost::icl::interval_set& set, const unsigned int file_version) { - boost::serialization::split_free(ar, set, file_version); -} - -} // namespace boost::serialization diff --git a/src/common/serialization/boost_small_vector.hpp b/src/common/serialization/boost_small_vector.hpp deleted file mode 100644 index b4e07a8962..0000000000 --- a/src/common/serialization/boost_small_vector.hpp +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef BOOST_SERIALIZATION_BOOST_SMALL_VECTOR_HPP -#define BOOST_SERIALIZATION_BOOST_SMALL_VECTOR_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -#pragma once -#endif - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// boost_vector.hpp: serialization for boost vector templates - -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . -// fast array serialization (C) Copyright 2005 Matthias Troyer -// Use, modification and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for updates, documentation, and revision history. - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -// default is being compatible with version 1.34.1 files, not 1.35 files -#ifndef BOOST_SERIALIZATION_VECTOR_VERSIONED -#define BOOST_SERIALIZATION_VECTOR_VERSIONED(V) (V == 4 || V == 5) -#endif - -namespace boost { -namespace serialization { - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// vector< T > - -// the default versions - -template -inline void save(Archive& ar, const boost::container::small_vector& t, - const unsigned int /* file_version */, mpl::false_) { - boost::serialization::stl::save_collection>(ar, - t); -} - -template -inline void load(Archive& ar, boost::container::small_vector& t, - const unsigned int /* file_version */, mpl::false_) { - const boost::archive::library_version_type library_version(ar.get_library_version()); - // retrieve number of elements - item_version_type item_version(0); - collection_size_type count; - ar >> BOOST_SERIALIZATION_NVP(count); - if (boost::archive::library_version_type(3) < library_version) { - ar >> BOOST_SERIALIZATION_NVP(item_version); - } - t.reserve(count); - stl::collection_load_impl(ar, t, count, item_version); -} - -// the optimized versions - -template -inline void save(Archive& ar, const boost::container::small_vector& t, - const unsigned int /* file_version */, mpl::true_) { - const collection_size_type count(t.size()); - ar << BOOST_SERIALIZATION_NVP(count); - if (!t.empty()) - // explict template arguments to pass intel C++ compiler - ar << serialization::make_array(static_cast(&t[0]), - count); -} - -template -inline void load(Archive& ar, boost::container::small_vector& t, - const unsigned int /* file_version */, mpl::true_) { - collection_size_type count(t.size()); - ar >> BOOST_SERIALIZATION_NVP(count); - t.resize(count); - unsigned int item_version = 0; - if (BOOST_SERIALIZATION_VECTOR_VERSIONED(ar.get_library_version())) { - ar >> BOOST_SERIALIZATION_NVP(item_version); - } - if (!t.empty()) - // explict template arguments to pass intel C++ compiler - ar >> serialization::make_array(static_cast(&t[0]), count); -} - -// dispatch to either default or optimized versions - -template -inline void save(Archive& ar, const boost::container::small_vector& t, - const unsigned int file_version) { - typedef typename boost::serialization::use_array_optimization::template apply< - typename remove_const::type>::type use_optimized; - save(ar, t, file_version, use_optimized()); -} - -template -inline void load(Archive& ar, boost::container::small_vector& t, - const unsigned int file_version) { -#ifdef BOOST_SERIALIZATION_VECTOR_135_HPP - if (ar.get_library_version() == boost::archive::library_version_type(5)) { - load(ar, t, file_version, boost::is_arithmetic()); - return; - } -#endif - typedef typename boost::serialization::use_array_optimization::template apply< - typename remove_const::type>::type use_optimized; - load(ar, t, file_version, use_optimized()); -} - -// split non-intrusive serialization function member into separate -// non intrusive save/load member functions -template -inline void serialize(Archive& ar, boost::container::small_vector& t, - const unsigned int file_version) { - boost::serialization::split_free(ar, t, file_version); -} - -// split non-intrusive serialization function member into separate -// non intrusive save/load member functions -template -inline void serialize(Archive& ar, boost::container::small_vector& t, - const unsigned int file_version) { - boost::serialization::split_free(ar, t, file_version); -} - -} // namespace serialization -} // namespace boost - -#endif // BOOST_SERIALIZATION_BOOST_SMALL_VECTOR_HPP diff --git a/src/common/serialization/boost_std_variant.hpp b/src/common/serialization/boost_std_variant.hpp deleted file mode 100644 index b00f827b1e..0000000000 --- a/src/common/serialization/boost_std_variant.hpp +++ /dev/null @@ -1,204 +0,0 @@ -#ifndef BOOST_SERIALIZATION_STD_VARIANT_HPP -#define BOOST_SERIALIZATION_STD_VARIANT_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// variant.hpp - non-intrusive serialization of variant types -// -// copyright (c) 2019 Samuel Debionne, ESRF -// -// Use, modification and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// See http://www.boost.org for updates, documentation, and revision history. -// -// Widely inspired form boost::variant serialization -// - -#include - -#include - -#include - -#include -#include -#include - -namespace boost { -namespace serialization { - -template -struct std_variant_save_visitor -{ - std_variant_save_visitor(Archive& ar) : - m_ar(ar) - {} - template - void operator()(T const & value) const - { - m_ar << BOOST_SERIALIZATION_NVP(value); - } -private: - Archive & m_ar; -}; - - -template -struct std_variant_load_visitor -{ - std_variant_load_visitor(Archive& ar) : - m_ar(ar) - {} - template - void operator()(T & value) const - { - m_ar >> BOOST_SERIALIZATION_NVP(value); - } -private: - Archive & m_ar; -}; - -template -void save( - Archive & ar, - std::variant const & v, - unsigned int /*version*/ -){ - const std::size_t which = v.index(); - ar << BOOST_SERIALIZATION_NVP(which); - std_variant_save_visitor visitor(ar); - std::visit(visitor, v); -} - -// Minimalist metaprogramming for handling parameter pack -namespace mp { - namespace detail { - template - struct front_impl; - - template