groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Re: mkstemp


From: John David Anglin
Subject: [Groff] Re: mkstemp
Date: Sat, 11 Aug 2001 20:26:22 -0400 (EDT)

> I've finally added a mkstemp routine to groff.  Please test.

With the enclosed patch, I am now able to build groff successfully
under vax-dec-ultrix4.3 with gcc 3.0.  There are a couple of gcc
patches not yet in the gcc tree.

Dave
-- 
J. David Anglin                                  address@hidden
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-08-11  John David Anglin  <address@hidden>

        * src/include/lib.h: Add prototypes for mkstemp and strcasecmp.
        * src/libs/libgroff/tmpname.cc: Add prototype for gettimeofday.
        * configure.ac: Add declaration tests for gettimeofday and strcasecmp.
        * Makefile.in: Document NEED_DECLARATION_GETTIMEOFDAY and
        NEED_DECLARATION_STRCASECMP defines.
        * aclocal.m4: Include sys/time.h for gettimeofday declaration test.
        * configure: Rebuilt.
        
--- ./src/include/lib.h.orig    Sat Jul 28 13:25:15 2001
+++ ./src/include/lib.h Fri Aug 10 13:06:56 2001
@@ -44,6 +44,7 @@
 #endif
 
 int mksdir(char *tmpl);
+int mkstemp(char *);
 
 FILE *xtmpfile(char **namep = 0,
               const char *postfix_long = 0, const char *postfix_short = 0,
@@ -74,6 +75,14 @@
 }
 
 #if !defined(_AIX) && !defined(sinix) && !defined(__sinix__)
+#ifdef HAVE_STRCASECMP
+#ifdef NEED_DECLARATION_STRCASECMP
+extern "C" {
+  // Ultrix4.3's string.h fails to declare this.
+  int strcasecmp(const char *, const char *);
+}
+#endif /* NEED_DECLARATION_STRCASECMP */
+#endif /* HAVE_STRCASECMP */
 #ifdef HAVE_STRNCASECMP
 #ifdef NEED_DECLARATION_STRNCASECMP
 extern "C" {
--- ./src/libs/libgroff/tmpname.cc.orig Fri Jul 20 10:36:55 2001
+++ ./src/libs/libgroff/tmpname.cc      Sat Aug 11 00:26:37 2001
@@ -39,6 +39,12 @@
 # include <sys/time.h>
 #endif
 
+#ifdef HAVE_GETTIMEOFDAY
+#ifdef NEED_DECLARATION_GETTIMEOFDAY
+extern "C" { int gettimeofday (struct timeval *, void *); }
+#endif
+#endif
+
 #if HAVE_STDINT_H
 # include <stdint.h>
 #endif
--- ./configure.ac.orig Sat Jul 28 13:25:10 2001
+++ ./configure.ac      Sat Aug 11 00:11:32 2001
@@ -26,10 +26,12 @@
 GROFF_ISC_SYSV3
 GROFF_POSIX
 GROFF_SRAND
+GROFF_NEED_DECLARATION(gettimeofday)
 GROFF_NEED_DECLARATION(hypot)
 GROFF_NEED_DECLARATION(popen)
 GROFF_NEED_DECLARATION(pclose)
 GROFF_NEED_DECLARATION(putenv)
+GROFF_NEED_DECLARATION(strcasecmp)
 GROFF_NEED_DECLARATION(strncasecmp)
 GROFF_SYS_NERR
 GROFF_SYS_ERRLIST
--- ./Makefile.in.orig  Sat Jul 28 13:25:09 2001
+++ ./Makefile.in       Sat Aug 11 00:15:09 2001
@@ -207,10 +207,16 @@
 # -DHAVE_STRSEP                        if you have strsep()
 # -DHAVE_STRTOL                        if you have strtol()
 #
+# -DNEED_DECLARATION_GETTIMEOFDAY
+#                              if your C++ <sys/time.h> doesn't declare
+#                              gettimeofday()
 # -DNEED_DECLARATION_HYPOT     if your C++ <math.h> doesn't declare hypot()
 # -DNEED_DECLARATION_PCLOSE    if your C++ <stdio.h> doesn't declare pclose()
 # -DNEED_DECLARATION_POPEN     if your C++ <stdio.h> doesn't declare popen()
 # -DNEED_DECLARATION_PUTENV    if your C++ <stdlib.h> doesn't declare putenv()
+# -DNEED_DECLARATION_STRCASECMP
+#                              if your C++ <string.h> doesn't declare
+#                              strcasecmp()
 # -DNEED_DECLARATION_STRNCASECMP
 #                              if your C++ <string.h> doesn't declare
 #                              strncasecmp()
--- ./aclocal.m4.orig   Sat Jul 28 13:25:09 2001
+++ ./aclocal.m4        Sat Aug 11 02:13:37 2001
@@ -461,6 +461,9 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif

reply via email to

[Prev in Thread] Current Thread [Next in Thread]