After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 637013 - gio/gdbusmessage.c fails to compile on Solaris
gio/gdbusmessage.c fails to compile on Solaris
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.26.x
Other Solaris
: Normal major
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-12-11 10:40 UTC by River Tarnell
Modified: 2011-01-29 01:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
solaris sys/mkdev.h patch (1.01 KB, patch)
2011-01-22 20:55 UTC, Fabian Groffen
none Details | Review

Description River Tarnell 2010-12-11 10:40:11 UTC
Tested on Solaris 10 update 9 with GCC 4.5.1.  gio/gdbusmessage.c uses the macros minor() and major() but fails to include <sys/mkdev.h> where they are defined.  The following trivial patch fixes the issue, but perhaps an autoconf check is needed.

--- gio/gdbusmessage.c.old      2010-11-22 12:29:06.933084000 +0000
+++ gio/gdbusmessage.c  2010-11-22 12:29:22.611336000 +0000
@@ -32,6 +32,7 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#include <sys/mkdev.h>
 
 #include "gdbusutils.h"
 #include "gdbusmessage.h"
Comment 1 River Tarnell 2010-12-11 10:40:46 UTC
Sorry, I forgot to mention: this is with glib 2.26.1.
Comment 2 Matthias Clasen 2010-12-13 15:09:07 UTC
my manpage says:

NAME
       makedev, major, minor - manage a device number

SYNOPSIS
       #define _BSD_SOURCE             /* See feature_test_macros(7) */
       #include <sys/types.h>

       dev_t makedev(int maj, int min);

       int major(dev_t dev);
       int minor(dev_t dev);


So, I guess this will need a configure check to find out how to get major/minor.
Comment 3 River Tarnell 2010-12-13 15:12:41 UTC
Solaris:

NAME
     makedev, major, minor - manage a device number

SYNOPSIS
     #include <sys/types.h>
     #include <sys/mkdev.h>

     dev_t makedev(major_t maj, minor_t min);

     major_t major(dev_t device);

     minor_t minor(dev_t device);
Comment 4 Fabian Groffen 2011-01-22 20:55:28 UTC
Created attachment 179056 [details] [review]
solaris sys/mkdev.h patch

This is the full patch, independently created from this bug.