mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2025-12-05 21:15:39 -05:00
[WIP] Linux support
This commit is contained in:
@@ -18,7 +18,7 @@ namespace {
|
||||
std::set<uint32_t> fully_fetched; // NOLINT(cert-err58-cpp)
|
||||
|
||||
std::string get_app_id_log(const uint32_t app_id) {
|
||||
return app_id ? fmt::format("App ID: {:>8}, ", app_id) : "";
|
||||
return app_id ? std::format("App ID: {:>8}, ", app_id) : "";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,9 +176,11 @@ namespace smoke_api::steam_apps {
|
||||
*pDlcId = dlc.get_id();
|
||||
*pbAvailable = config::is_dlc_unlocked(app_id, *pDlcId, is_originally_unlocked);
|
||||
|
||||
auto name = dlc.get_name();
|
||||
name = name.substr(0, cchNameBufferSize + 1);
|
||||
memcpy_s(pchName, cchNameBufferSize, name.c_str(), name.size());
|
||||
const auto& name = dlc.get_name();
|
||||
|
||||
const auto bytes_to_copy = std::min(static_cast<size_t>(cchNameBufferSize - 1), name.size());
|
||||
std::memcpy(pchName, name.c_str(), bytes_to_copy);
|
||||
pchName[bytes_to_copy] = '\0'; // Ensure null-termination
|
||||
};
|
||||
|
||||
if(app_dlcs.contains(app_id)) {
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace smoke_api::steam_inventory {
|
||||
try {
|
||||
const auto success = original_function();
|
||||
|
||||
LOG_DEBUG("{} -> Handle: {}", function_name, fmt::ptr(pResultHandle));
|
||||
LOG_DEBUG("{} -> Handle: {}", function_name, static_cast<void*>(pResultHandle));
|
||||
|
||||
if(success && pInstanceIDs != nullptr) {
|
||||
for(int i = 0; i < unCountInstanceIDs; i++) {
|
||||
|
||||
@@ -42,15 +42,17 @@
|
||||
* have to omit it from the function signature.
|
||||
*
|
||||
* The macros below implement the above-mentioned considerations.
|
||||
* Also, note the ## prefix before __VA_ARGS__. This enables a GCC extension
|
||||
* which strips trailing comma if __VA_ARGS__ is empty.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
#define PARAMS(...) const void* RCX, __VA_ARGS__
|
||||
#define ARGS(...) RCX, __VA_ARGS__
|
||||
#define PARAMS(...) const void* RCX, ##__VA_ARGS__
|
||||
#define ARGS(...) RCX, ##__VA_ARGS__
|
||||
#define THIS RCX
|
||||
#define DECLARE_EDX()
|
||||
#else
|
||||
#define PARAMS(...) const void* ECX, const void* EDX, __VA_ARGS__
|
||||
#define ARGS(...) ECX, EDX, __VA_ARGS__
|
||||
#define PARAMS(...) const void* ECX, const void* EDX, ##__VA_ARGS__
|
||||
#define ARGS(...) ECX, EDX, ##__VA_ARGS__
|
||||
#define THIS ECX
|
||||
#define DECLARE_EDX() const void* EDX = nullptr;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user