Procházet zdrojové kódy

Rebase fixes: build under v145 and restore slot connection id

srw_lock.h: drop constexpr from the six members; they call non-constexpr Win32 functions (C3615).
steam_lifecycle.cpp: drop the unused lambda parameter name in initialize (C4100 as error).
bap_listener.cpp: accept_peer uses connection_id(slot), matching the PR base; slot + 1 shifted ids past kSessionCount.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017y4GeUXaw46fq2mDFGBVHN
stan před 4 dny
rodič
revize
eb4727bcd4

+ 6 - 6
Sunrise/src/core/threading/srw_lock.h

@@ -15,28 +15,28 @@ public:
     SrwLock& operator=(SrwLock&&) = delete;
 
     // stl Lockable
-    constexpr void lock() noexcept {
+    void lock() noexcept {
         AcquireSRWLockExclusive(&lock_);
     }
 
-    [[nodiscard]] constexpr bool try_lock() noexcept {
+    [[nodiscard]] bool try_lock() noexcept {
         return TryAcquireSRWLockExclusive(&lock_);
     }
 
-    constexpr void unlock() noexcept {
+    void unlock() noexcept {
         ReleaseSRWLockExclusive(&lock_);
     }
 
     // stl SharedLockable
-    constexpr void lock_shared() noexcept {
+    void lock_shared() noexcept {
         AcquireSRWLockShared(&lock_);
     }
 
-    [[nodiscard]] constexpr bool try_lock_shared() noexcept {
+    [[nodiscard]] bool try_lock_shared() noexcept {
         return TryAcquireSRWLockShared(&lock_);
     }
 
-    constexpr void unlock_shared() noexcept {
+    void unlock_shared() noexcept {
         ReleaseSRWLockShared(&lock_);
     }
 

+ 1 - 1
Sunrise/src/server/transport/bap_listener.cpp

@@ -51,7 +51,7 @@ void accept_peer(Listener& listener, std::size_t slot) noexcept {
     peer.streamSize = 0;
     peer.outputOffset = 0;
     peer.outputSize = 0;
-    peer.connectionId = connection_id(slot + 1);
+    peer.connectionId = connection_id(slot);
 
     std::array<char, core::log::kLineCapacity> line{};
     const int written = std::snprintf(

+ 1 - 1
Sunrise/src/steam/runtime/steam_lifecycle.cpp

@@ -60,7 +60,7 @@ bool initialize(void* module) noexcept {
         return false;
     }
 
-    return g_lifecycle.lock_write([module](Lifecycle& lifecycle) {
+    return g_lifecycle.lock_write([module](Lifecycle&) {
         if (g_initialized.load(std::memory_order_acquire)) {
             return true;
         }