Skip to content

Commit

Permalink
Fix a few recently introduced code smells (#9412)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-derevenetz authored Jan 5, 2025
1 parent 076150e commit ee5bdfb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/dist/Makefile.emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
CCFLAGS := $(filter-out -pthread,$(CCFLAGS)) \
--use-port=sdl2 \
--use-port=sdl2_mixer \
--use-port=zlib \
-Wno-variadic-macro-arguments-omitted
--use-port=zlib

LDFLAGS := $(filter-out -pthread,$(LDFLAGS)) \
--preload-file ../../../files/data/resurrection.h2d@/files/data/resurrection.h2d \
Expand Down
10 changes: 10 additions & 0 deletions src/engine/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,12 +659,22 @@ int StreamFile::closeFile( std::FILE * f )

#ifdef __EMSCRIPTEN__
if ( needSyncFS ) {
#if defined( __GNUC__ )
#pragma GCC diagnostic push

#pragma GCC diagnostic ignored "-Wvariadic-macro-arguments-omitted"
#endif

EM_ASM(
// The following code is not C++ code, but JavaScript code.
// clang-format off
FS.syncfs( err => err && console.warn( "FS.syncfs() error:", err ) )
// clang-format on
);

#if defined( __GNUC__ )
#pragma GCC diagnostic pop
#endif
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/engine/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#include <cassert>
#include <memory>

#ifdef __EMSCRIPTEN__
namespace
{
#ifdef __EMSCRIPTEN__
class MutexUnlocker
{
public:
Expand All @@ -47,8 +47,8 @@ namespace
private:
std::mutex & _mutex;
};
#endif
}
#endif

namespace MultiThreading
{
Expand Down

0 comments on commit ee5bdfb

Please sign in to comment.