mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-22 01:30:25 +01:00
Use gdnative api to get constants only for javascript platform
When trying to load the library in a non-Mono Godot editor v3.3.2 an error is printed about godot_get_global_constants(). Furthermore, the issue with using the GlobalConstants header to get constants is only present on the javascript platform, so we can revert all other platforms to the old way of getting constants.
This commit is contained in:
parent
302bdf0714
commit
0743f2a97a
1 changed files with 6 additions and 7 deletions
|
@ -8,7 +8,7 @@
|
|||
#include <xkbcommon/xkbcommon-keysyms.h>
|
||||
|
||||
// For _populate_key_list(), see below.
|
||||
#if defined(__WIN32)
|
||||
#if !defined(__EMSCRIPTEN__)
|
||||
#include <GlobalConstants.hpp>
|
||||
#endif
|
||||
|
||||
|
@ -21,12 +21,11 @@ void Terminal::_populate_key_list() {
|
|||
if (!_key_list.empty())
|
||||
return;
|
||||
|
||||
// GitHub action for Windows throws the error:
|
||||
// `error LNK2019: unresolved external symbol godot_get_global_constants
|
||||
// referenced in function "private: static void __cdecl
|
||||
// godot::Terminal::_populate_key_list(void)"` so use the old technique of
|
||||
// getting KeyList values from GlobalConstants header for now.
|
||||
#if defined(__WIN32)
|
||||
// The following error is thrown on the javascript platform when using
|
||||
// GlobalConstants from the header: abort(Assertion failed: bad export type for
|
||||
// `_ZN5godot15GlobalConstants8KEY_KP_0E`: undefined). Build with -s
|
||||
// ASSERTIONS=1 for more info.
|
||||
#if !defined(__EMSCRIPTEN__)
|
||||
#define GLOBAL_CONSTANT(VAR) GlobalConstants::VAR
|
||||
#else
|
||||
#define GLOBAL_CONSTANT(VAR) get_constant(#VAR)
|
||||
|
|
Loading…
Reference in a new issue