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 126376 - Uncoinditional definition of _XOPEN_SOURCE breaks build on NetBSD
Uncoinditional definition of _XOPEN_SOURCE breaks build on NetBSD
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.11.x
Other All
: Normal major
: ---
Assigned To: Behdad Esfahbod
Nalin Dahyabhai
Depends on:
Blocks:
 
 
Reported: 2003-11-06 16:34 UTC by Adrian Bunk
Modified: 2006-04-23 07:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (2.40 KB, patch)
2004-12-05 21:51 UTC, Dan Winship
committed Details | Review

Description Adrian Bunk 2003-11-06 16:34:19 UTC
I got the following compile error:

<--  snip  -->

...
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include
-I/usr/local/include/free
type2 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include
-I/usr/loc
al/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include
-I/usr/local/include/atk-1.0
 -I/usr/local/include/pango-1.0 -I/usr/X11R6/include -I/usr/X11R6/include
-O2 -m
cpu=v8 -I/usr/X11R6/include -I/usr/X11R6/include -O2 -mcpu=v8 -c pty.c
-Wp,-MD,.
deps/pty.TPlo  -fPIC -DPIC -o .libs/pty.o
In file included from pty.c:23:
/usr/include/sys/socket.h:186: parse error before `u_char'
/usr/include/sys/socket.h:186: warning: no semicolon at end of struct or union
/usr/include/sys/socket.h:187: warning: data definition has no type or
storage c
lass
/usr/include/sys/socket.h:189: parse error before `}'
pty.c: In function `_vte_pty_read_ptypair':
pty.c:818: `u_char' undeclared (first use in this function)
pty.c:818: (Each undeclared identifier is reported only once
pty.c:818: for each function it appears in.)
pty.c:818: parse error before `)'
gmake[2]: *** [pty.lo] Error 1
gmake[2]: Leaving directory `/aux/adrian/build/vte-0.11.10/src'
gmake[1]: *** [all-recursive] Error 1

<--  snip  -->


The declaration of u_char in /usr/include/sys/types.h is:

<--  snip  -->

...
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
typedef unsigned char   u_char;
typedef unsigned short  u_short;
typedef unsigned int    u_int;
typedef unsigned long   u_long;
...

<--  snip  -->


The compilation breaks because of the unconditional definition of
_XOPEN_SOURCE in configure.in .
Comment 1 alexander.winston 2004-01-29 04:57:40 UTC
Adding the portability keyword.
Comment 2 Dan Winship 2004-12-05 21:51:15 UTC
Created attachment 34517 [details] [review]
patch

This patch fixes the problem by only defining XOPEN_SOURCE on solaris,
since that's the only place it's needed
Comment 3 Behdad Esfahbod 2006-04-23 07:25:29 UTC
2006-04-23  Behdad Esfahbod  <behdad@gnome.org>

        Bug 126376 – Uncoinditional definition of _XOPEN_SOURCE breaks build
        on NetBSD
        Patch from Dan Winship.

        * configure.in:
        * gnome-pty-helper/configure.in: Define XOPEN_SOURCE on solaris only.