IgnorantGuru / spacefm

SpaceFM File Manager
http://ignorantguru.github.com/spacefm/
GNU General Public License v3.0
490 stars 72 forks source link

Compatibility with new glibc 2.28 #727

Open vp1981 opened 5 years ago

vp1981 commented 5 years ago

Hello, according this paragraph in release news of GLIBC 2.28:

The macros 'major', 'minor', and 'makedev' are now only available from the header <sys/sysmacros.h>; not from <sys/types.h> or various other headers that happen to include <sys/types.h>. These macros are rarely used, not part of POSIX nor XSI, and their names frequently collide with user code; see https://sourceware.org/bugzilla/show_bug.cgi?id=19239 for further explanation.

<sys/sysmacros.h> is a GNU extension. Portable programs that require these macros should first include <sys/types.h>, and then include <sys/sysmacros.h> if __GNU_LIBRARY__ is defined.

the main.c needs a following patch to be compiled on systems with new glibc.

diff --git a/src/main.c b/src/main.c                                                                                                                                              
index 645e2ec..9453a3b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,6 +23,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
+#include <sys/sysmacros.h>

 #include <signal.h>

WBR, Vladimir Lomov

orbea commented 5 years ago

I can confirm this patch is needed to compile spacefm with glibc-2.28.

henninb commented 4 years ago

The patch works as designed. Thanks for the tip!