[glib: 5/12] meson: compile GUnixCredentialsMessage on all platforms




commit af1777d3d3d77682ccb218eec7efb46a1d0776e0
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Wed Jan 19 15:49:44 2022 +0400

    meson: compile GUnixCredentialsMessage on all platforms
    
    The header is now also installed under the common GIO include directory.
    
    Sorry if it breaks any build, you had to use the correct header path.
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 docs/reference/gio/meson.build |  1 -
 gio/gunixcredentialsmessage.c  | 10 ++++++++++
 gio/meson.build                |  4 ++--
 3 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/gio/meson.build b/docs/reference/gio/meson.build
index 34a361bdf..dba062055 100644
--- a/docs/reference/gio/meson.build
+++ b/docs/reference/gio/meson.build
@@ -109,7 +109,6 @@ if get_option('gtk_doc')
     ignore_headers += [
       'gfiledescriptorbased.h',
       'gunixconnection.h',
-      'gunixcredentialsmessage.h',
       'gunixmounts.h',
       'gunixfdlist.h',
       'gunixfdmessage.h',
diff --git a/gio/gunixcredentialsmessage.c b/gio/gunixcredentialsmessage.c
index 9e5c7d32e..e8ac5a73c 100644
--- a/gio/gunixcredentialsmessage.c
+++ b/gio/gunixcredentialsmessage.c
@@ -31,6 +31,14 @@
  * g_unix_connection_receive_credentials(). To receive credentials of
  * a foreign process connected to a socket, use
  * g_socket_get_credentials().
+ *
+ * Since GLib 2.72, #GUnixCredentialMessage is available on all platforms. It
+ * requires underlying system support (such as Windows 10 with `AF_UNIX`) at run
+ * time.
+ *
+ * Before GLib 2.72, `<gio/gunixcredentialsmessage.h>` belonged to the UNIX-specific
+ * GIO interfaces, thus you had to use the `gio-unix-2.0.pc` pkg-config file
+ * when using it. This is no longer necessary since GLib 2.72.
  */
 
 #include "config.h"
@@ -40,7 +48,9 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include "gunixcredentialsmessage.h"
 #include "gcredentials.h"
diff --git a/gio/meson.build b/gio/meson.build
index 1ba9ce356..9e7539edd 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -347,7 +347,6 @@ if host_system != 'windows'
     'gfiledescriptorbased.c',
     'giounix-private.c',
     'gunixconnection.c',
-    'gunixcredentialsmessage.c',
     'gunixfdlist.c',
     'gunixfdmessage.c',
     'gunixmount.c',
@@ -376,7 +375,6 @@ if host_system != 'windows'
   gio_unix_include_headers = files(
     'gfiledescriptorbased.h',
     'gunixconnection.h',
-    'gunixcredentialsmessage.h',
     'gunixmounts.h',
     'gunixfdlist.h',
     'gunixfdmessage.h',
@@ -567,6 +565,7 @@ gio_sources = files(
   'gdtlsclientconnection.c',
   'gdtlsserverconnection.c',
   'gunionvolumemonitor.c',
+  'gunixcredentialsmessage.c',
   'gunixsocketaddress.c',
   'gvfs.c',
   'gvolume.c',
@@ -703,6 +702,7 @@ gio_headers = files(
   'gdtlsconnection.h',
   'gdtlsclientconnection.h',
   'gdtlsserverconnection.h',
+  'gunixcredentialsmessage.h',
   'gunixsocketaddress.h',
   'gvfs.h',
   'gvolume.h',


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