struct winsize on OSF1?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > struct winsize on OSF1?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    struct winsize on OSF1?  
Michael B Allen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-26-05 11: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





[ Post a follow-up to this message ]



    Re: struct winsize on OSF1?  
Bjorn Reese


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-27-05 12:47 PM

Michael B Allen wrote:

> #if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_OSF_SOURCE)

> cc -g -D_XOPEN_SOURCE=500 -DVARRAY_INIT_SIZE=3 \

> If I define _OSF_SOURCE it works. Why? Isn't TIOCGWINSZ a standard
> ioctl?

I presume that setting _XOPEN_SOURCE to 500 does not cause the macro
_XOPEN_SOURCE_EXTENDED to be defined.

> 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.

I think -source_listing is your best bet. Try to combine it with -E or
-show.

--
mail1dotstofanetdotdk





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:17 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register