Skip to content

Commit

Permalink
Make the static_assert stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-derevenetz committed Jan 4, 2025
1 parent 120c27d commit b310179
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/engine/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include <emscripten.h>
#include <errno.h>
#include <fcntl.h>

#include "tools.h"
#endif

#include "logging.h"
Expand Down Expand Up @@ -635,7 +637,7 @@ int StreamFile::closeFile( std::FILE * f )
{
#ifdef __EMSCRIPTEN__
const bool needSyncFS = [f]() {
static_assert( O_WRONLY > 0 && O_RDWR > 0 );
static_assert( CountBits( O_WRONLY ) == 1 && CountBits( O_RDWR ) == 1 );

const int fn = fileno( f );
if ( fn < 0 ) {
Expand Down

0 comments on commit b310179

Please sign in to comment.