| Michael B Allen 2005-03-26, 6:05 pm |
| /usr/include/sys/ioctl.h has:
#if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_OSF_SOURCE)
struct winsize {
unsigned short ws_row; /* rows, in characters */
unsigned short ws_col; /* columns, in characters */
unsigned short ws_xpixel; /* horizontal size, pixels */
unsigned short ws_ypixel; /* vertical size, pixels */
};
and yet I get the following error:
$ make
cc -g -D_XOPEN_SOURCE=500 -DVARRAY_INIT_SIZE=3 \
-Isrc -c -o src/shellout.o src/shellout.c
cc: Error: src/shellout.c, line 159: In this declaration, "win"
has no linkage and is of an incomplete type. (incompnolink)
struct winsize win;
-----------------------^
cc: Error: src/shellout.c, line 193: In this statement,
"TIOCGWINSZ" is not declared. (undeclared)
if (ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&win) < 0) {
-----------------------------^
*** Exit 1
Stop.
If I define _OSF_SOURCE it works. Why? Isn't TIOCGWINSZ a standard
ioctl?
Is there a way to print the macros defined like gcc -E -dM file.c on
OSF1? The -source_listing option doesn't work becuase it trips up the
error too.
Mike
|