portability fixes for header inclusion etc.
authorGary Houston <ghouston@arglist.com>
Wed, 7 Aug 1996 09:46:41 +0000 (09:46 +0000)
committerGary Houston <ghouston@arglist.com>
Wed, 7 Aug 1996 09:46:41 +0000 (09:46 +0000)
27 files changed:
libguile/ChangeLog
libguile/Makefile.in
libguile/__scm.h
libguile/async.c
libguile/configure
libguile/configure.in
libguile/error.c
libguile/feature.c
libguile/fports.c
libguile/gc.c
libguile/genio.c
libguile/init.c
libguile/ioext.c
libguile/mallocs.c
libguile/ports.c
libguile/posix.c
libguile/ramap.h
libguile/read.c
libguile/scmconfig.h.in
libguile/simpos.c
libguile/socket.c
libguile/strings.h
libguile/strports.c
libguile/struct.c
libguile/symbols.c
libguile/unif.c
libguile/vports.c

index 008b289..ba7005f 100644 (file)
@@ -1,3 +1,53 @@
+Wed Aug  7 06:28:42 1996  Gary Houston  <ghouston@actrix.gen.nz>
+
+       * Fixes motivated by Petr Adamek <adamek@mit.edu>:
+
+       * unif.c: include ramap.h.
+
+       * read.c (endif): case_insensative_p renamed case_insensitive_p.
+
+       * ramap.h: rename scm_array_copy prototypes to scm_array_copy_x.
+
+       * ports.c: include sys/ioctl.h.
+
+       * scmconfig.h.in: add HAVE_SYS_IOCTL_H.
+
+       * configure.in: check for sys/ioctl.h.
+
+       * ports.c: include <malloc.h> not "malloc.h".
+
+       * mallocs.c: include <malloc.h> not "malloc.h", likewise for unistd.h.
+
+       * fports.c: remove ttyname and tmpnam declarations.
+
+       * posix.c: fewer ttyname declarations.
+
+       * fports.c: include <string.h> not "string.h".
+
+       * init.c, ioext.c: include string.h and unistd.h.
+
+       * gc.c: include <malloc.h> not "malloc.h", likewise for unistd.h.
+
+       * async.c, strings.h, strports.c, struct.c, symbols.c, feature.c, genio.c, simpos.c, vports.c:
+       include string.h.
+
+       * socket.c, fdsocket.c: include string.h only if HAVE_STRING_H.
+
+       * fdsocket.c (getsockopt, setsockopt): change type of optlen from 
+       scm_sizet to int.
+       (scm_addr_buffer_size): change type from scm_sizet to int.
+       (accept, getsockname, getpeername, recvfrom): change type of tmp_size
+       from scm_sizet to int.
+
+       * error.c: include unistd.h.
+
+       * __scm.h: (SCM_SYSMISSING): another version in case ENOSYS isn't
+       defined.
+
+       * Makefile.in: remove references to .hd, .cd suffix and __scm.hd.
+
+       * __scm.hd, def.sed: deleted.
+
 Tue Aug  6 14:49:08 1996  Jim Blandy  <jimb@totoro.cyclic.com>
 
        Changes for NeXT, suggested by Robert Brown.
index 0b21719..389ca28 100644 (file)
@@ -144,7 +144,7 @@ libobjs=    alist.o \
                $(extras)
 
 
-uninstalled_h_files= _scm.h __scm.hd
+uninstalled_h_files= _scm.h
 
 installed_h_files= __scm.h \
                alist.h \
@@ -365,21 +365,7 @@ manifest = $(ancillary) $(c_sources)
 
 
 .SUFFIXES:
-.SUFFIXES: .o .c .h .ps .dvi .info .texinfo .scm .cd .x .hd
-
-.cd.c:
-       (   echo "/* DO NOT EDIT  --- AUTO-GENERATED --- DO NOT EDIT */" > $@ \
-        && echo -n "#line 1" \" \
-        && echo $<\" | sed -e "s,^.*/,," >> $@ \
-        && sed -f $(srcdir)/def.sed $< >> $@) \
-        || rm -f $@
-
-.hd.h:
-       (   echo "/* DO NOT EDIT  --- AUTO-GENERATED --- DO NOT EDIT */" > $@ \
-        && echo -n "#line 1" \" >> $@ \
-        && echo $<\" | sed -e "s,^.*/,," >> $@ \
-        && sed -f $(srcdir)/def.sed $< >> $@) \
-        || rm -f $@
+.SUFFIXES: .o .c .h .ps .dvi .info .texinfo .scm .x
 
 .c.x:
        if test ! -escmconfig.h ; then \
@@ -477,8 +463,6 @@ depends:
        rm $(gen_c_files)
        rm scmconfig.h
 
-$(srcdir)/__scm.h: __scm.hd
-
 ###
 alist.o : alist.c _scm.h libguile.h __scm.h tags.h smob.h params.h alist.h append.h \
   arbiters.h async.h boolean.h chars.h continuations.h dynwind.h eq.h error.h \
index ec870b7..e5c7e3f 100644 (file)
@@ -1,5 +1,3 @@
-/* DO NOT EDIT  --- AUTO-GENERATED --- DO NOT EDIT */
-#line 1 "__scm.hd"
 /* classes: h_files */
 
 #ifndef __SCMH
@@ -180,7 +178,6 @@ typedef unsigned long ulong_long;
 # endif                                /* ndef _CRAY1 */
 #endif                         /* ndef vms */
 
-
 /* James Clark came up with this neat one instruction fix for
  * continuations on the SPARC.  It flushes the register windows so
  * that all the state of the process is contained in the stack. 
@@ -285,6 +282,7 @@ extern unsigned int scm_async_clock;
         if (!(_cond)) \
           goto _label
 #endif
+
 #define SCM_SYSERROR(_subr) \
        scm_everr (SCM_UNDEFINED, SCM_EOL, SCM_UNDEFINED, \
                   strerror (errno), _subr)
@@ -295,10 +293,15 @@ extern unsigned int scm_async_clock;
                   scm_makfrom0str (_subr), \
                   SCM_UNDEFINED));
      */
-#define SCM_SYSMISSING(_subr) \
-       scm_everr (SCM_UNDEFINED, SCM_EOL, SCM_UNDEFINED, \
-                  strerror (ENOSYS), _subr)
-
+#ifdef ENOSYS
+# define SCM_SYSMISSING(_subr) \
+     scm_everr (SCM_UNDEFINED, SCM_EOL, SCM_UNDEFINED, \
+               strerror (ENOSYS), _subr)
+#else
+# define SCM_SYSMISSING(_subr) \
+     scm_everr (SCM_UNDEFINED, SCM_EOL, SCM_UNDEFINED, \
+               "missing function, even ENOSYS is missing", _subr)
+#endif
 #define SCM_ARGn               0
 #define SCM_ARG1               1
 #define SCM_ARG2               2
index 7a94227..2658ca3 100644 (file)
@@ -44,6 +44,9 @@
 #include <signal.h>
 #include "_scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
index 842aeb9..862c182 100755 (executable)
@@ -1210,7 +1210,7 @@ EOF
 
 fi
 
-for ac_hdr in libc.h limits.h malloc.h memory.h string.h sys/select.h sys/time.h sys/timeb.h sys/times.h sys/types.h time.h unistd.h
+for ac_hdr in libc.h limits.h malloc.h memory.h string.h sys/ioctl.h sys/select.h sys/time.h sys/timeb.h sys/times.h sys/types.h time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
index efcd678..92fa3f2 100644 (file)
@@ -20,7 +20,7 @@ AC_HEADER_STDC
 AC_HEADER_DIRENT
 AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(libc.h limits.h malloc.h memory.h string.h sys/select.h sys/time.h sys/timeb.h sys/times.h sys/types.h time.h unistd.h)
+AC_CHECK_HEADERS(libc.h limits.h malloc.h memory.h string.h sys/ioctl.h sys/select.h sys/time.h sys/timeb.h sys/times.h sys/types.h time.h unistd.h)
 
 AC_TYPE_GETGROUPS
 AC_TYPE_SIGNAL
index c166125..ba51e8b 100644 (file)
@@ -43,6 +43,9 @@
 #include <stdio.h>
 #include "_scm.h"
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 \f
 
 \f
index b4622b7..2a0916c 100644 (file)
@@ -43,6 +43,9 @@
 #include <stdio.h>
 #include "_scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 \f
 
 SCM *scm_loc_features;
index 34264a7..fbd5eb4 100644 (file)
 
 #include <stdio.h>
 #include "_scm.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #else
-char *ttyname ();
-char *tmpnam ();
 scm_sizet fwrite ();
 #endif
-#ifdef HAVE_STRING_H
-#include "string.h"
-#endif
 
 
 #ifdef __IBMC__
 #include <io.h>
 #include <direct.h>
-#define ttyname(x) "CON:"
 #else
 #ifndef MSDOS
 #ifndef ultrix
index 26e7181..80427a8 100644 (file)
 #include "_scm.h"
 
 #ifdef HAVE_MALLOC_H
-#include "malloc.h"
+#include <malloc.h>
 #endif
 
 #ifdef HAVE_UNISTD_H
-#include "unistd.h"
+#include <unistd.h>
 #endif
 
 \f
index 6bc0825..5e43d04 100644 (file)
@@ -43,6 +43,9 @@
 #include <stdio.h>
 #include "_scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 \f
 
 
index 2f65c15..32bc509 100644 (file)
 #include <stdio.h>
 #include "_scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 \f
 
 #ifdef __STDC__
index 4dea9f7..a873eb3 100644 (file)
 
 
 #include <stdio.h>
-#include <unistd.h>
 #include "fd.h"
 #include "_scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 \f
 
 SCM_PROC (s_sys_ftell, "ftell", 1, 0, 0, scm_sys_ftell);
index 27f1a79..0f3022e 100644 (file)
 #include "_scm.h"
 #include "mallocs.h"
 #ifdef HAVE_MALLOC_H
-#include "malloc.h"
+#include <malloc.h>
 #endif
 #ifdef HAVE_UNISTD_H
-#include "unistd.h"
+#include <unistd.h>
 #endif
 
 
index b571552..63acf17 100644 (file)
 
 
 #ifdef HAVE_MALLOC_H
-#include "malloc.h"
+#include <malloc.h>
 #endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
 \f
 
 
index 3636a50..08b2ac5 100644 (file)
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#else
+#ifndef ttyname
+extern char *ttyname();
+#endif
 #endif
 
 #ifdef HAVE_SYS_SELECT_H
 
 #endif /* no FD_SET */
 
-extern char *ttyname ();
 extern FILE *popen ();
 extern char ** environ;
 
@@ -602,10 +605,6 @@ scm_setsid ()
   return SCM_UNSPECIFIED;
 }
 
-#ifndef ttyname
-extern char * ttyname();
-#endif
-
 SCM_PROC (s_ttyname, "ttyname", 1, 0, 0, scm_ttyname);
 #ifdef __STDC__
 SCM 
index a198f59..cb0ccd4 100644 (file)
@@ -52,7 +52,7 @@ extern int scm_ra_matchp (SCM ra0, SCM ras);
 extern int scm_ramapc (int (*cproc) (), SCM data, SCM ra0, SCM lra, char *what);
 extern int scm_array_fill_int (SCM ra, SCM fill, SCM ignore);
 extern SCM scm_array_fill_x (SCM ra, SCM fill);
-extern SCM scm_array_copy (SCM src, SCM dst);
+extern SCM scm_array_copy_x (SCM src, SCM dst);
 extern int scm_ra_eqp (SCM ra0, SCM ras);
 extern int scm_ra_lessp (SCM ra0, SCM ras);
 extern int scm_ra_leqp (SCM ra0, SCM ras);
@@ -75,7 +75,7 @@ extern int scm_ra_matchp ();
 extern int scm_ramapc ();
 extern int scm_array_fill_int ();
 extern SCM scm_array_fill_x ();
-extern SCM scm_array_copy ();
+extern SCM scm_array_copy_x ();
 extern int scm_ra_eqp ();
 extern int scm_ra_lessp ();
 extern int scm_ra_leqp ();
index 1340fc1..e25cd40 100644 (file)
 SCM_PROC (s_read, "read", 0, 3, 0, scm_read);
 #ifdef __STDC__
 SCM 
-scm_read (SCM port, SCM case_insensative_p, SCM sharp)
+scm_read (SCM port, SCM case_insensitive_p, SCM sharp)
 #else
 SCM 
-scm_read (port, case_insensative_p, sharp)
+scm_read (port, case_insensitive_p, sharp)
      SCM port;
-     SCM case_insensative_p;
+     SCM case_insensitive_p;
      SCM sharp;
 #endif
 {
@@ -72,9 +72,9 @@ scm_read (port, case_insensative_p, sharp)
   else
     SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port), port, SCM_ARG1, s_read);
 
-  case_i = (SCM_UNBNDP (case_insensative_p)
+  case_i = (SCM_UNBNDP (case_insensitive_p)
            ? default_case_i
-           : (case_insensative_p == SCM_BOOL_F));
+           : (case_insensitive_p == SCM_BOOL_F));
   
   if (SCM_UNBNDP (sharp))
     sharp = SCM_BOOL_F;
index f8de4b9..07703d5 100644 (file)
 /* Define if you have the <sys/types.h> header file.  */
 #undef HAVE_SYS_TYPES_H
 
+/* Define if you have the <sys/ioctl.h> header file.  */
+#undef HAVE_SYS_IOCTL_H
+
 /* Define if you have the <time.h> header file.  */
 #undef HAVE_TIME_H
 
index a29cb30..970c6a0 100644 (file)
 
 #include <stdio.h>
 #include "_scm.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
index cea6b53..2c3c571 100644 (file)
@@ -8,8 +8,12 @@
 \f
 
 #include <stdio.h>
-#include <string.h>
 #include "_scm.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
index 6615e23..8529457 100644 (file)
 
 #include "__scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 \f
 
 #define SCM_STRINGP(x) (SCM_TYP7S(x)==scm_tc7_string)
index 1ba808a..29ef1d3 100644 (file)
 #include <stdio.h>
 #include "_scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 \f
 
 /* {Ports - string ports}
index 265c7d4..a15c550 100644 (file)
 #include <stdio.h>
 #include "_scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 \f
 
 static SCM required_vtable_fields = SCM_BOOL_F;
index 4a6dd60..78c8193 100644 (file)
 #include <stdio.h>
 #include "_scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 \f
 
 
index ed0e17c..7969915 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <stdio.h>
 #include "_scm.h"
+#include "ramap.h"
 
 \f
 /* The set of uniform scm_vector types is:
index dbb67cb..dfe6e13 100644 (file)
 #include <stdio.h>
 #include "_scm.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 \f
 
 /* {Ports - soft ports}