[gspell/wip/cmake] cmake: config.h.in: always #define OS_OSX (to 0 or 1)



commit 74d7ceac2ce0b7fe313bc6d9174975288e53588b
Author: Sébastien Wilmet <swilmet informatique-libre be>
Date:   Tue Aug 16 16:00:00 2022 +0200

    cmake: config.h.in: always #define OS_OSX (to 0 or 1)
    
    I prefer that way, because the #define *always* needs to exist.
    Otherwise we may forget to #define it and it becomes dead code.
    
    A further step will be to define 0 or 1 from CMake.

 config.h.in              | 4 ++--
 gspell/gspell-init.c     | 4 ++--
 gspell/gspell-language.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/config.h.in b/config.h.in
index 4ca66b3..1560254 100644
--- a/config.h.in
+++ b/config.h.in
@@ -3,8 +3,8 @@
 /* Define to the gettext package name. */
 #define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
 
-/* Defined if OS is Mac OSX. */
-#undef OS_OSX
+/* Define for Mac OSX. */
+#define OS_OSX 0
 
 /* Define to the address where bug reports for this package should be sent. */
 #define PACKAGE_BUGREPORT "https://gitlab.gnome.org/GNOME/gspell/issues";
diff --git a/gspell/gspell-init.c b/gspell/gspell-init.c
index a84cfa2..1101cbf 100644
--- a/gspell/gspell-init.c
+++ b/gspell/gspell-init.c
@@ -33,7 +33,7 @@
 static HMODULE gspell_dll;
 #endif
 
-#ifdef OS_OSX
+#if OS_OSX
 #include <Cocoa/Cocoa.h>
 
 static gchar *
@@ -99,7 +99,7 @@ get_locale_dir (void)
        locale_dir = g_build_filename (win32_dir, "share", "locale", NULL);
 
        g_free (win32_dir);
-#elif defined (OS_OSX)
+#elif OS_OSX
        locale_dir = dirs_os_x_get_locale_dir ();
 #else
        locale_dir = g_build_filename (DATADIR, "locale", NULL);
diff --git a/gspell/gspell-language.c b/gspell/gspell-language.c
index 397fd21..e9b5fd8 100644
--- a/gspell/gspell-language.c
+++ b/gspell/gspell-language.c
@@ -26,7 +26,7 @@
 #include <enchant.h>
 #include "gspell-icu.h"
 
-#ifdef OS_OSX
+#if OS_OSX
 #include "gspell-osx.h"
 #endif
 
@@ -153,7 +153,7 @@ gspell_language_get_default (void)
        }
 
        /* Another try specific to Mac OS X */
-#ifdef OS_OSX
+#if OS_OSX
        {
                gchar *code = _gspell_osx_get_preferred_spell_language ();
 


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