Mousepad and posix_madvise
Enrico Tröger
enrico.troeger at uvena.de
Sun Apr 15 14:05:21 CEST 2007
Hi,
since I upgraded to GTK 2.10 I want to test Nick's new mousepad and ran
into a strange error:
mousepad-file.c: In function ‘mousepad_file_read_to_buffer’:
mousepad-file.c:298: warning: implicit declaration of function
‘posix_madvise’ mousepad-file.c:298: error: ‘POSIX_MADV_SEQUENTIAL’
undeclared (first use in this function) mousepad-file.c:298: error:
(Each undeclared identifier is reported only once mousepad-file.c:298:
error: for each function it appears in.) make[3]: ***
[mousepad-mousepad-file.o] Fehler 1
So, after asking our friend google, I found that
#define __USE_XOPEN2K 1
in mousepad-file.c before the inclusion of sys/mman.h would solve the
problem. But then I found a similar problem discussed[1] on the
thunar-ML and Benny added the following to thunar's configure.in.in:
dnl ******************************************
dnl *** Linux/glibc specified work-arounds ***
dnl ******************************************
AC_MSG_CHECKING([whether we need _BSD_SOURCE and _XOPEN_SOURCE])
AC_TRY_LINK([#include <features.h>],
[
if (__GLIBC_PREREQ (2, 0));
],
[
AC_DEFINE([_XOPEN_SOURCE], [600], [Required to unbreak glibc])
AC_DEFINE([_BSD_SOURCE], [1], [Required to unbreak glibc])
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
])
Probably, this is also useful for mousepad?
Nick, what do you think?
I ran into this on my Debian Testing with manually upgraded GTK 2.10
packages but the problem itself should be related to using glibc.
Furthermore, while compiling I get some warnings about usage of
uninitialised variables which stops compiling when using -Werror.
Should be easy to fix.
[1] http://www.mail-archive.com/thunar-dev@xfce.org/msg00200.html
Regards,
Enrico
--
Get my GPG key from http://www.uvena.de/pub.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20070415/66e50c65/attachment.pgp>
More information about the Xfce4-dev
mailing list