[glib: 1/2] gcontenttype: Add no-op versions of {get, set}_mime_dirs() on win32/macOS



commit 3de1b88339b5814b4877d9f264a8d5f10a4a769e
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Jun 18 11:33:44 2019 +0100

    gcontenttype: Add no-op versions of {get,set}_mime_dirs() on win32/macOS
    
    These are here to prevent linker errors, since `gcontenttype.[ch]`
    aren’t compiled on Windows or macOS.
    
    The implementations are stubs to be filled out by someone who knows each
    platform, at some point in the future.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Fixes: #1791

 gio/gcontenttype-win32.c | 15 +++++++++++++++
 gio/gosxcontenttype.m    | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
---
diff --git a/gio/gcontenttype-win32.c b/gio/gcontenttype-win32.c
index 74d1b704c..2f07fa36e 100644
--- a/gio/gcontenttype-win32.c
+++ b/gio/gcontenttype-win32.c
@@ -83,6 +83,21 @@ get_registry_classes_key (const char    *subdir,
   return value_utf8;
 }
 
+/*< private >*/
+void
+g_content_type_set_mime_dirs (const gchar * const *dirs)
+{
+  /* noop on Windows */
+}
+
+/*< private >*/
+const gchar * const *
+g_content_type_get_mime_dirs (void)
+{
+  const gchar * const *mime_dirs = { NULL };
+  return mime_dirs;
+}
+
 gboolean
 g_content_type_equals (const gchar *type1,
                        const gchar *type2)
diff --git a/gio/gosxcontenttype.m b/gio/gosxcontenttype.m
index 52ba5763a..6119bbcae 100644
--- a/gio/gosxcontenttype.m
+++ b/gio/gosxcontenttype.m
@@ -100,6 +100,21 @@ create_cstr_from_cfstring_with_fallback (CFStringRef  str,
   return cstr;
 }
 
+/*< private >*/
+void
+g_content_type_set_mime_dirs (const gchar * const *dirs)
+{
+  /* noop on macOS */
+}
+
+/*< private >*/
+const gchar * const *
+g_content_type_get_mime_dirs (void)
+{
+  const gchar * const *mime_dirs = { NULL };
+  return mime_dirs;
+}
+
 gboolean
 g_content_type_equals (const gchar *type1,
                        const gchar *type2)


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