Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: fdtable



I wrote:
> Shouldn't fdtable[] be `signed char'? (Yes.)

Zefram just pointed out the simplest thing to do was simply to define
signed to nothing if it isn't supported.  Here's the third attempt.
I'd be obliged if somebody using a K&R compiler could have a go at it.
(I did try it by altering the cached value to `no'.)

*** config.h.in.sig	Tue May  7 15:42:38 1996
--- config.h.in	Tue May  7 16:43:33 1996
***************
*** 96,101 ****
--- 96,104 ----
  /* Define to 1 if compiler incorrectly cast signed to unsigned */
  #undef BROKEN_SIGNED_TO_UNSIGNED_CASTING
  
+ /* Define to nothing if compiler does not handle `signed' keyword */
+ #undef signed
+ 
  /* Define if your system defines TIOCGWINSZ in sys/ioctl.h.  */
  #undef GWINSZ_IN_SYS_IOCTL
  
*** configure.in.sig	Fri May  3 20:54:33 1996
--- configure.in	Tue May  7 16:40:11 1996
***************
*** 154,159 ****
--- 154,167 ----
    AC_DEFINE(BROKEN_SIGNED_TO_UNSIGNED_CASTING)
  fi
  
+ dnl  Checking if complier handles `signed' keyword
+ AC_CACHE_CHECK(if the signed keyword is handled, zsh_cv_signed_keyword,
+ [AC_TRY_COMPILE(, [signed char foo; foo = -1;],
+ zsh_cv_signed_keyword=yes, zsh_cv_signed_keyword=no)])
+ if test $zsh_cv_signed_keyword = no; then
+   AC_DEFINE(signed, )
+ fi
+ 
  dnl ------------------
  dnl CHECK FOR PROGRAMS
  dnl ------------------
*** Src/globals.h.sig	Tue May  7 15:43:49 1996
--- Src/globals.h	Tue May  7 16:41:01 1996
***************
*** 397,403 ****
   * table is not used.  A table element is set by movefd and cleard *
   * by zclose.                                                      */
  
! EXTERN char fdtable[OPEN_MAX];
  
  /* input fd from the coprocess */
  
--- 397,403 ----
   * table is not used.  A table element is set by movefd and cleard *
   * by zclose.                                                      */
  
! EXTERN signed char fdtable[OPEN_MAX];
  
  /* input fd from the coprocess */
  
-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.




Messages sorted by: Reverse Date, Date, Thread, Author