Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Nov 13, 2024
1 parent ebb6a18 commit e705c45
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ env:
jobs:
# Older gcc version (should be close to our minimum supported version)
gcc_7:
if: ${{ false }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -86,6 +87,7 @@ jobs:
# Older clang version (should be close to our minimum supported version)
clang_7:
if: ${{ false }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion src/client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with Freeminer. If not, see <http://www.gnu.org/licenses/>.
*/

#include <atomic>
#include <cstdint>
#include <iostream>
#include <algorithm>
Expand Down Expand Up @@ -450,7 +451,7 @@ void Client::connect(const Address &address, const std::string &address_name,

void Client::step(float dtime)
{
m_uptime.fetch_add(dtime, std::memory_order::relaxed);
m_uptime = m_uptime + dtime;

// Limit a bit
if (dtime > DTIME_LIMIT)
Expand Down
3 changes: 3 additions & 0 deletions src/porting_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include "irrlichttypes_bloated.h"
#include <string>

class JNIEnv;
class android_app;

namespace porting {
/**
* Show a text input dialog in Java
Expand Down
11 changes: 8 additions & 3 deletions src/threading/lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ along with Freeminer. If not, see <http://www.gnu.org/licenses/>.

#include "../config.h"

#ifdef _WIN32

#include "../threading/mutex.h"
using use_mutex = std::mutex;

/*
#ifdef _WIN32
using use_mutex = std::mutex;
using try_shared_mutex = use_mutex;
using maybe_shared_lock = std::unique_lock<try_shared_mutex>;
using unique_lock = std::unique_lock<try_shared_mutex>;
const auto try_to_lock = std::try_to_lock;

#else
typedef std::mutex use_mutex;
Expand All @@ -50,6 +51,8 @@ const auto try_to_lock = boost::try_to_lock;
#elif HAVE_SHARED_MUTEX
//#elif __cplusplus >= 201305L
*/


#include <shared_mutex>
using try_shared_mutex = std::shared_mutex;
Expand All @@ -58,6 +61,7 @@ using unique_lock = std::unique_lock<try_shared_mutex>;
const auto try_to_lock = std::try_to_lock;
#define LOCK_TWO 1

/*
#else
using try_shared_mutex = use_mutex;
Expand All @@ -67,6 +71,7 @@ const auto try_to_lock = std::try_to_lock;
#endif
#endif
*/

// http://stackoverflow.com/questions/4792449/c0x-has-no-semaphores-how-to-synchronize-threads
/* uncomment when need
Expand Down

0 comments on commit e705c45

Please sign in to comment.