[gjs/master.msvc: 3/4] gjs/global.cpp: Fix linking on Visual Studio builds
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/master.msvc: 3/4] gjs/global.cpp: Fix linking on Visual Studio builds
- Date: Wed, 5 Feb 2020 08:55:24 +0000 (UTC)
commit 1af068ccd50386146295b04486a9e9ef9ab75dc4
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Feb 5 16:23:03 2020 +0800
gjs/global.cpp: Fix linking on Visual Studio builds
It seems that Visual Studio does not like using external variables from a
static constexpr construct in terms of linking to a DLL, so fix this by
using a global constant that pulls in the external (constant) variable that we
are using, and use that global constant in our static constexpr construct,
which will fix linking on Visual Studio.
gjs/global.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gjs/global.cpp b/gjs/global.cpp
index 68002a77..2ebeeab2 100644
--- a/gjs/global.cpp
+++ b/gjs/global.cpp
@@ -225,11 +225,13 @@ gjs_printerr(JSContext *context,
return true;
}
+const JSClassOps defaultclassops = JS::DefaultGlobalClassOps;
+
class GjsGlobal {
static constexpr JSClass klass = {
"GjsGlobal",
JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(GJS_GLOBAL_SLOT_LAST),
- &JS::DefaultGlobalClassOps,
+ &defaultclassops,
};
static constexpr JSFunctionSpec static_funcs[] = {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]