From: bill@Celestial.COM (Bill Campbell)
Subject: Re: Problems with SCO DEVSYS 3.2.4d include files - help?
Organization: Celestial Software, Mercer Island, WA
Distribution: na
Date: Sun, 15 Nov 1992 23:08:14 GMT

In <dan.721847198@dribble> dan@dribble.c-mols.siu.edu (Dan Ellison) writes:

:I am evaluating the SCO devsys version 3.2.4d here and am experiencing
:some real problems with the include files not defining some pretty
:standard things (like sys/types.h and sys/signal.h.)

:Specifically, I am trying to build gcc-2.3.1.  I have built it without
:any problems using the 3.2.0 devsys package.  However, when I try it

In general, these are due to conflicts on the __STDC__ manifest
define and crop up in several places including definitions of
fileno, type_t...

My solution was to copy the problem include files from the
/usr/include directory to /usr/local/include directory
(maintaining of course the directory hierarchy), and edit the
files appropriately, generally adding a defined(__GNUC__) to an
existing ifdef.

Here are the diffs from my compilation of gcc2.2.2 under
ODT2.0(beta).  I haven't messed with this since the final release
came out since gcc2.2.2 isn't broken on my machine :-).  There
isn't a whole lot to do (some of the changes are a result of my
adding /*{*/ and /*}*/ to #ifdefs, #else, and #endifs to help me
match them up using the '%' feature of vi).

Bill
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  diffs
# Wrapped by bill@camco1 on Sun Nov 15 15:06:31 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'diffs' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'diffs'\"
else
echo shar: Extracting \"'diffs'\" \(8230 characters\)
sed "s/^X//" >'diffs' <<'END_OF_FILE'
Xdiff -cr /usr/include/netdb.h ./netdb.h
X*** /usr/include/netdb.h	Wed Apr 15 13:27:59 1992
X--- ./netdb.h	Mon Jul 20 16:09:03 1992
X***************
X*** 75,80 ****
X--- 75,82 ----
X   * extern int h_errno).
X   */
X  
X+ extern int h_errno;
X+ 
X  #define	HOST_NOT_FOUND	1	/* Authoritative Answer Host not found */
X  #define	TRY_AGAIN	2	/* Non-Authoritive Host not found, or
X  				 * SERVERFAIL */
Xdiff -cr /usr/include/stdio.h ./stdio.h
X*** /usr/include/stdio.h	Wed Apr  8 13:40:30 1992
X--- ./stdio.h	Mon Apr 13 22:45:09 1992
X***************
X*** 210,222 ****
X  extern   int            __filbuf();
X  extern   int            __flsbuf();
X  #endif /* !_STRICT_NAMES */
X! #if defined(_XOPEN_SOURCE) || !__STDC__
X  extern int         putw();
X  extern int         getw();
X  extern FILE        *popen();
X  extern int         pclose();
X  extern char        *tempnam();
X! #endif /* defined(_XOPEN_SOURCE) || !__STDC__ */
X  #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  extern FILE        *fdopen();
X  extern int	    fileno();
X--- 210,222 ----
X  extern   int            __filbuf();
X  extern   int            __flsbuf();
X  #endif /* !_STRICT_NAMES */
X! #if defined(_XOPEN_SOURCE) || !__STDC__ /*{*/
X  extern int         putw();
X  extern int         getw();
X  extern FILE        *popen();
X  extern int         pclose();
X  extern char        *tempnam();
X! #endif /*} defined(_XOPEN_SOURCE) || !__STDC__ */
X  #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  extern FILE        *fdopen();
X  extern int	    fileno();
X***************
X*** 288,300 ****
X  extern   int            __flsbuf(unsigned char, FILE *);
X  #endif /* !_STRICT_NAMES */
X  
X! #if defined(_XOPEN_SOURCE) || !__STDC__
X  extern int         putw(int, FILE *);
X  extern int         getw(FILE *);
X  extern FILE        *popen(const char *, const char *);
X  extern int         pclose(FILE *);
X  extern char        *tempnam(const char *,const char *);
X! #endif /* defined(_XOPEN_SOURCE) || !__STDC__ */
X  
X  #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  extern FILE        *fdopen(int, const char *);
X--- 288,300 ----
X  extern   int            __flsbuf(unsigned char, FILE *);
X  #endif /* !_STRICT_NAMES */
X  
X! #if defined(__GNUC__) || defined(_XOPEN_SOURCE) || !__STDC__ /*{*/
X  extern int         putw(int, FILE *);
X  extern int         getw(FILE *);
X  extern FILE        *popen(const char *, const char *);
X  extern int         pclose(FILE *);
X  extern char        *tempnam(const char *,const char *);
X! #endif /*} defined(__GNUC__) || defined(_XOPEN_SOURCE) || !__STDC__ */
X  
X  #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  extern FILE        *fdopen(int, const char *);
X***************
X*** 310,316 ****
X  };
X  #endif /* __cplusplus */
X  
X! #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  #define L_ctermid     9
X  #define L_cuserid     9
X  #define fileno(p)   ((p)->__file)
X--- 310,316 ----
X  };
X  #endif /* __cplusplus */
X  
X! #if defined(__GNUC__) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  #define L_ctermid     9
X  #define L_cuserid     9
X  #define fileno(p)   ((p)->__file)
Xdiff -cr /usr/include/sys/errno.h ./sys/errno.h
X*** /usr/include/sys/errno.h	Thu May  2 18:12:41 1991
X--- ./sys/errno.h	Thu Sep 17 03:36:38 1992
X***************
X*** 32,38 ****
X  #define _M_XOUT M_XOUT
X  #endif /* Eliminate name space pollution */
X  
X! #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  /*
X   * Error codes
X   */
X--- 32,38 ----
X  #define _M_XOUT M_XOUT
X  #endif /* Eliminate name space pollution */
X  
X! #if defined(__GNUC__) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  /*
X   * Error codes
X   */
X***************
X*** 99,105 ****
X  #define	ENOLCK	46	/* No record locks available.		*/
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
X  
X! #if !__STDC__
X  /* Convergent Error Returns */
X  #define EBADE	50	/* invalid exchange			*/
X  #define EBADR	51	/* invalid request descriptor		*/
X--- 99,105 ----
X  #define	ENOLCK	46	/* No record locks available.		*/
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
X  
X! #if defined(__GNUC__) || !__STDC__
X  /* Convergent Error Returns */
X  #define EBADE	50	/* invalid exchange			*/
X  #define EBADR	51	/* invalid request descriptor		*/
X***************
X*** 153,159 ****
X  #define ENOSYS		89
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
X  
X! #if !__STDC__
X  /*
X   *	System V STREAMS TCP
X   */
X--- 153,159 ----
X  #define ENOSYS		89
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
X  
X! #if defined(__GNUC__) || !__STDC__
X  /*
X   *	System V STREAMS TCP
X   */
Xdiff -cr /usr/include/sys/signal.h ./sys/signal.h
X*** /usr/include/sys/signal.h	Thu Dec  5 13:25:05 1991
X--- ./sys/signal.h	Tue Apr 14 16:05:46 1992
X***************
X*** 50,62 ****
X  #define __lint lint
X  #endif /* Eliminate name space pollution */
X  
X! #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  #define	SIGHUP	1	/* hangup */
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
X  
X  #define	SIGINT	2	/* interrupt (rubout) */
X  
X! #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  #define	SIGQUIT	3	/* quit (ASCII FS) */
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
X  
X--- 50,62 ----
X  #define __lint lint
X  #endif /* Eliminate name space pollution */
X  
X! #if defined(__GNUC__) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  #define	SIGHUP	1	/* hangup */
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
X  
X  #define	SIGINT	2	/* interrupt (rubout) */
X  
X! #if defined(__GNUC__) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  #define	SIGQUIT	3	/* quit (ASCII FS) */
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
X  
X***************
X*** 89,95 ****
X  #define	SIGSYS	12	/* bad argument to system call */
X  #endif /* !__STDC__ */
X  
X! #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  #define	SIGPIPE	13	/* write on a pipe with no one to read it */
X  #define	SIGALRM	14	/* alarm clock */
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
X--- 89,95 ----
X  #define	SIGSYS	12	/* bad argument to system call */
X  #endif /* !__STDC__ */
X  
X! #if defined(__GNUC__) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
X  #define	SIGPIPE	13	/* write on a pipe with no one to read it */
X  #define	SIGALRM	14	/* alarm clock */
X  #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
Xdiff -cr /usr/include/sys/times.h ./sys/times.h
X*** /usr/include/sys/times.h	Mon Jul 22 13:38:45 1991
X--- ./sys/times.h	Mon Apr 13 20:40:16 1992
X***************
X*** 24,29 ****
X--- 24,31 ----
X  
X  /* #ident	"@)#(head.sys:times.h	1.3" */
X  
X+ #include <utime.h>
X+ 
X  #ifndef _CLOCK_T
X  #define _CLOCK_T
X  typedef long	clock_t;	/* Stolen from types.h */
X***************
X*** 39,62 ****
X  	clock_t	tms_cstime;		/* system time, children */
X  };
X  
X! #ifndef _INKERNEL
X! #ifdef _NO_PROTOTYPE
X  extern clock_t times();
X! #if !_STRICT_NAMES
X! extern int utime();
X! #endif /* !_STRICT_NAMES */
X! #else
X! #ifdef __cplusplus
X  extern "C" {
X! #endif /* __cplusplus */
X  extern clock_t times(struct tms *);
X! #if !_STRICT_NAMES
X! extern int utime(const char *, struct utimbuf *);
X! #endif /* !_STRICT_NAMES */
X! #ifdef __cplusplus
X  };
X! #endif /* __cplusplus */
X! #endif /* _NO_PROTOTYPE */
X! #endif	/* !_INKERNEL */
X  
X  #endif	/* _SYS_TIMES_H */
X--- 41,64 ----
X  	clock_t	tms_cstime;		/* system time, children */
X  };
X  
X! #ifndef _INKERNEL	/*{*/
X! #ifdef _NO_PROTOTYPE	/*{*/
X  extern clock_t times();
X! #if !_STRICT_NAMES	/*{*/
X! /* extern int utime(); */
X! #endif /*} !_STRICT_NAMES */
X! #else	/*} _NO_PROTOTYPE {*/
X! #ifdef __cplusplus	/*{*/
X  extern "C" {
X! #endif /*} __cplusplus */
X  extern clock_t times(struct tms *);
X! #if !_STRICT_NAMES	/*{*/
X! /* extern int utime(const char *, struct utimbuf *); */
X! #endif /*} !_STRICT_NAMES */
X! #ifdef __cplusplus	/*{*/
X  };
X! #endif /*} __cplusplus */
X! #endif /*} _NO_PROTOTYPE */
X! #endif	/*} !_INKERNEL */
X  
X  #endif	/* _SYS_TIMES_H */
END_OF_FILE
if test 8230 -ne `wc -c <'diffs'`; then
    echo shar: \"'diffs'\" unpacked with wrong size!
fi
# end of 'diffs'
fi
echo shar: End of shell archive.
exit 0
-- 
INTERNET:  bill@Celestial.COM   Bill Campbell; Celestial Software
UUCP:   ...!thebes!camco!bill   6641 East Mercer Way
             uunet!camco!bill   Mercer Island, WA 98040; (206) 947-5591
SPEED COSTS MONEY -- HOW FAST DO YOU WANT TO GO?
Newsgroups: biz.sco.opendesktop,comp.unix.sysv386,comp.unix.programmer