/* Copyright <2018-2024> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef REPERTORY_INCLUDE_UTILS_CONFIG_HPP_ #define REPERTORY_INCLUDE_UTILS_CONFIG_HPP_ #if defined(_WIN32) #define WINVER 0x0602 #define _WIN32_WINNT WINVER #define WIN32_LEAN_AND_MEAN #include #include #include #if defined(PROJECT_ENABLE_WINFSP) #include #endif // defined(PROJECT_ENABLE_WINFSP) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else // !defined(_WIN32) #include #include #include #include #include #include #include #include #include #if defined(__LFS64__) #include #else #include #endif #if defined(__linux__) #include #endif // defined(HAS_SETXATTR) #if defined(HAS_SETXATTR) #include #include #endif // defined(HAS_SETXATTR) #if defined(__APPLE__) #include #include #include #include #include #endif // defined(__APPLE__) #include #endif // defined(_WIN32) #if defined(HAS_WORDEXP_H) #include #endif // defined(HAS_WORDEXP_H) #if defined(__cplusplus) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif // defined(__cplusplus) #if defined(PROJECT_ENABLE_CURL) #include "curl/curl.h" #include "curl/multi.h" #endif // defined(PROJECT_ENABLE_CURL) #if defined(PROJECT_ENABLE_FUSE) #if FUSE_USE_VERSION >= 30 #include #include #else #include #endif #endif // defined(PROJECT_ENABLE_FUSE) #if defined(PROJECT_ENABLE_FZF) #if defined(__cplusplus) extern "C" { #endif // defined(__cplusplus) #include "fzf.h" #if defined(__cplusplus) } #endif // defined(__cplusplus) #endif // defined(PROJECT_ENABLE_FZF) #if defined(PROJECT_ENABLE_LIBEVENT) #include "event2/buffer.h" #include "event2/bufferevent.h" #include "event2/listener.h" #include "event2/thread.h" #include "event2/util.h" #endif // defined(PROJECT_ENABLE_LIBEVENT) #if defined(PROJECT_ENABLE_SDL) #include "SDL.h" #include "SDL_gamecontroller.h" #include "SDL_joystick.h" #endif // defined(PROJECT_ENABLE_SDL) #if defined(PROJECT_ENABLE_LIBSODIUM) #include "sodium.h" #endif // defined(PROJECT_ENABLE_LIBSODIUM) #if defined(PROJECT_ENABLE_SQLITE) #include "sqlite3.h" #endif // defined(PROJECT_ENABLE_SQLITE) #if defined(__cplusplus) #if defined(PROJECT_ENABLE_BOOST) #include "boost/archive/text_iarchive.hpp" #include "boost/archive/text_oarchive.hpp" #include "boost/asio.hpp" #include "boost/asio/io_context.hpp" #include "boost/bind/bind.hpp" #include "boost/dynamic_bitset.hpp" #include "boost/dynamic_bitset/serialization.hpp" #include "boost/endian/conversion.hpp" #include "boost/integer.hpp" #include "boost/interprocess/sync/named_mutex.hpp" #include "boost/interprocess/sync/scoped_lock.hpp" #include "boost/multiprecision/cpp_dec_float.hpp" #include "boost/multiprecision/cpp_int.hpp" #include "boost/serialization/vector.hpp" #endif // defined(PROJECT_ENABLE_BOOST) #if defined(PROJECT_ENABLE_CPP_HTTPLIB) #include "httplib.h" #endif // defined(PROJECT_ENABLE_JSON) #if defined(PROJECT_ENABLE_DTL) #include "dtl/dtl.hpp" #endif // defined(PROJECT_ENABLE_DTL) #if defined(PROJECT_ENABLE_JSON) #include "json.hpp" #endif // defined(PROJECT_ENABLE_JSON) #if defined(PROJECT_ENABLE_NANA) #include "nana/gui.hpp" #include "nana/gui/timer.hpp" #include "nana/gui/widgets/button.hpp" #include "nana/gui/widgets/combox.hpp" #include "nana/gui/widgets/group.hpp" #include "nana/gui/widgets/label.hpp" #include "nana/gui/widgets/panel.hpp" #include "nana/gui/widgets/picture.hpp" #include "nana/gui/widgets/tabbar.hpp" #endif // defined(PROJECT_ENABLE_NANA) #if defined(PROJECT_ENABLE_PUGIXML) #include "pugixml.hpp" #endif // defined(PROJECT_ENABLE_PUGIXML) #if defined(PROJECT_ENABLE_ROCKSDB) #include "rocksdb/db.h" #include "rocksdb/utilities/transaction_db.h" #endif // defined(PROJECT_ENABLE_ROCKSDB) #if defined(PROJECT_ENABLE_SFML) #include "RoundedRectangleShape.hpp" #include "SFML/Graphics.hpp" #include "Text2.hpp" #endif // defined(PROJECT_ENABLE_SFML) #if defined(PROJECT_ENABLE_SAGO_PLATFORM_FOLDERS) #include "platform_folders.hpp" #endif // defined(PROJECT_ENABLE_SAGO_PLATFORM_FOLDERS) #if defined(PROJECT_ENABLE_SPDLOG) #include "spdlog/async.h" #include "spdlog/fmt/bundled/core.h" #include "spdlog/fmt/bundled/format.h" #include "spdlog/fmt/chrono.h" #include "spdlog/sinks/rotating_file_sink.h" #include "spdlog/sinks/stdout_color_sinks.h" #include "spdlog/spdlog.h" #endif // defined(PROJECT_ENABLE_SPDLOG) #if defined(PROJECT_ENABLE_STDUUID) #include "uuid.h" #endif // defined(PROJECT_ENABLE_STDUUID) #if defined(PROJECT_ENABLE_TPL) #include "process.hpp" #endif // defined(PROJECT_ENABLE_TPL) #if defined(PROJECT_ENABLE_WINFSP) #include "winfsp/winfsp.hpp" #endif // defined(PROJECT_ENABLE_WINFSP) #if !defined(fstat64) #define fstat64 fstat #endif // !defined(fstat64) #if !defined(pread64) #define pread64 pread #endif // !defined(pread64) #if !defined(pwrite64) #define pwrite64 pwrite #endif // !defined(pwrite64) #if !defined(stat64) #define stat64 stat #endif // !defined(stat64) #if !defined(statfs64) #define statfs64 statfs #endif // !defined(statfs64) #if !defined(off64_t) #define off64_t std::size_t #endif // !defined(off64_t) #if !defined(__off64_t) #define __off64_t off64_t #endif // !defined(__off64_t) namespace repertory { using data_buffer = std::vector; using mutex_lock = std::lock_guard; using recur_mutex_lock = std::lock_guard; using unique_mutex_lock = std::unique_lock; using unique_recur_mutex_lock = std::unique_lock; template struct overloaded : Ts... { using Ts::operator()...; }; template overloaded(Ts...) -> overloaded; struct file_deleter final { void operator()(FILE *file) { if (file != nullptr) { fclose(file); } } }; using file_t = std::unique_ptr; } // namespace repertory #endif // defined(__cplusplus) #endif // REPERTORY_INCLUDE_UTILS_CONFIG_HPP_