[gjs/meson.msvc: 6/8] gjs/*.cpp, util/*.cpp: Use XP_WIN instead of G_OS_WIN32



commit 30fadec27a598200f458283a731595a61fa5d83f
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Oct 25 15:25:01 2019 +0800

    gjs/*.cpp, util/*.cpp: Use XP_WIN instead of G_OS_WIN32
    
    We might be checking for G_OS_WIN32 before we include the GLib headers,
    so check for the presence of XP_WIN, since we define it for our MSVC
    builds via Meson or NMake Makefiles.

 gjs/context.cpp    | 4 ++--
 gjs/engine.cpp     | 4 ++--
 gjs/importer.cpp   | 4 ++--
 gjs/jsapi-util.cpp | 4 ++--
 util/log.cpp       | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 5eae9eac..88ee7d81 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -43,7 +43,7 @@
 #include <glib-object.h>
 #include <glib.h>
 
-#ifdef G_OS_WIN32
+#ifdef XP_WIN
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #endif
@@ -282,7 +282,7 @@ gjs_context_class_init(GjsContextClass *klass)
 
     /* For GjsPrivate */
     {
-#ifdef G_OS_WIN32
+#ifdef XP_WIN
         extern HMODULE gjs_dll;
         char *basedir = g_win32_get_package_installation_directory_of_module (gjs_dll);
         char *priv_typelib_dir = g_build_filename (basedir, "lib", "girepository-1.0", NULL);
diff --git a/gjs/engine.cpp b/gjs/engine.cpp
index 2b61d98b..a70897a6 100644
--- a/gjs/engine.cpp
+++ b/gjs/engine.cpp
@@ -23,7 +23,7 @@
 
 #include <stdint.h>
 
-#ifdef G_OS_WIN32
+#ifdef XP_WIN
 #    define WIN32_LEAN_AND_MEAN
 #    include <windows.h>
 #endif
@@ -248,7 +248,7 @@ class GjsSourceHook : public js::SourceHook {
     }
 };
 
-#ifdef G_OS_WIN32
+#ifdef XP_WIN
 HMODULE gjs_dll;
 static bool gjs_is_inited = false;
 
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 8d0d7401..f5a5406e 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -23,7 +23,7 @@
 
 #include <string.h>  // for size_t, strcmp, strlen
 
-#ifdef G_OS_WIN32
+#ifdef XP_WIN
 #    define WIN32_LEAN_AND_MEAN
 #    include <windows.h>
 #endif
@@ -907,7 +907,7 @@ static const char* const* gjs_get_search_path(void) {
         }
 
         /* ${datadir}/share/gjs-1.0 */
-#ifdef G_OS_WIN32
+#ifdef XP_WIN
         extern HMODULE gjs_dll;
         char *basedir = g_win32_get_package_installation_directory_of_module (gjs_dll);
         char *gjs_data_dir = g_build_filename (basedir, "share", "gjs-1.0", NULL);
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 6804aeaf..bc463107 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -661,7 +661,7 @@ JSObject* gjs_get_import_global(JSContext* cx) {
     return GjsContextPrivate::from_cx(cx)->global();
 }
 
-#if defined(G_OS_WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1900))
+#if defined(XP_WIN) && (defined(_MSC_VER) && (_MSC_VER >= 1900))
 /* Unfortunately Visual Studio's C++ .lib somehow did not contain the right
  * codecvt stuff that we need to convert from utf8 to utf16 (char16_t), so we
  * need to work around this Visual Studio bug.  Use Windows API
@@ -686,7 +686,7 @@ static std::wstring gjs_win32_vc140_utf8_to_utf16(const char* str,
 #endif
 
 std::u16string gjs_utf8_script_to_utf16(const char* script, ssize_t len) {
-#if defined(G_OS_WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1900))
+#if defined(XP_WIN) && (defined(_MSC_VER) && (_MSC_VER >= 1900))
     std::wstring wscript = gjs_win32_vc140_utf8_to_utf16(script, len);
     return std::u16string(reinterpret_cast<const char16_t*>(wscript.c_str()));
 #else
diff --git a/util/log.cpp b/util/log.cpp
index 4286a408..a58edb7d 100644
--- a/util/log.cpp
+++ b/util/log.cpp
@@ -26,7 +26,7 @@
 #include <stdio.h>   // for FILE, fprintf, fflush, fopen, fputs, fseek
 #include <string.h>  // for strchr, strcmp
 
-#ifdef G_OS_WIN32
+#ifdef XP_WIN
 # include <io.h>
 # include <process.h>
 # ifndef F_OK


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]