Skip to content

Commit

Permalink
Silence quickjs.h warning on Clang >= 19
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Jan 13, 2025
1 parent 21616f5 commit a7bcad4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/wzmaplib/src/map_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 19
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
#endif
#if defined(_MSC_VER)
__pragma(warning( push ))
__pragma(warning( disable : 4191 )) // disable "warning C4191: 'type cast': unsafe conversion from 'JSCFunctionMagic (__cdecl *)' to 'JSCFunction (__cdecl *)'"
Expand All @@ -44,6 +48,9 @@ __pragma(warning( disable : 4191 )) // disable "warning C4191: 'type cast': unsa
#if defined(_MSC_VER)
__pragma(warning( pop ))
#endif
#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 19
#pragma clang diagnostic pop
#endif
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8
#pragma GCC diagnostic pop
#endif
Expand Down
7 changes: 7 additions & 0 deletions src/quickjs_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,19 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 19
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
#endif
MSVC_PRAGMA(warning( push ))
MSVC_PRAGMA(warning( disable : 4191 )) // disable "warning C4191: 'type cast': unsafe conversion from 'JSCFunctionMagic (__cdecl *)' to 'JSCFunction (__cdecl *)'"
#include "quickjs.h"
#include "quickjs-debugger.h"
#include "quickjs-limitedcontext.h"
MSVC_PRAGMA(warning( pop ))
#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 19
#pragma clang diagnostic pop
#endif
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8
#pragma GCC diagnostic pop
#endif
Expand Down

0 comments on commit a7bcad4

Please sign in to comment.