bison-patches
[Top][All Lists]
Advanced

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

04-stage.patch


From: Akim Demaille
Subject: 04-stage.patch
Date: Tue, 30 Jul 2002 14:15:05 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        `stage' was accidently included in a previous patch.
        Initiate its autoconfiscation.

        * configure.in: Look for malloc.h and sys/times.h.
        * src/main.c (stage): Adjust.
        Report only when trace_flag.

Index: configure.in
--- configure.in Fri, 03 May 2002 23:39:21 +0200 akim
+++ configure.in Tue, 30 Jul 2002 09:33:10 +0200 akim
@@ -78,7 +78,8 @@

 # Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(ctype.h locale.h memory.h stdlib.h string.h unistd.h)
+AC_CHECK_HEADERS([ctype.h locale.h malloc.h memory.h stdlib.h string.h \
+                  sys/times.h unistd.h])


 # Checks for compiler characteristics.
Index: src/main.c
--- src/main.c Mon, 29 Jul 2002 19:31:35 +0200 akim
+++ src/main.c Tue, 30 Jul 2002 09:28:24 +0200 akim
@@ -39,23 +39,37 @@
 #include "conflicts.h"
 #include "print_graph.h"
 #include "muscle_tab.h"
-#include <malloc.h>
-#include <sys/times.h>

 /* The name this program was run with, for messages.  */
 char *program_name;

+
+/*--------------------------.
+| Tracking space and time.  |
+`--------------------------*/
+
+#if HAVE_MALLOC_H & HAVE_SYS_TIMES_H
+# include <malloc.h>
+# include <sys/times.h>
+#endif
+
 static void
 stage (const char *title)
 {
-  struct mallinfo minfo = mallinfo ();
-  struct tms tinfo;
-  times (&tinfo);
-  fprintf (stderr, "STAGE: %30s: %9d (%9d): %ldu %lds\n",
-          title,
-          minfo.uordblks, minfo.arena,
-          tinfo.tms_utime, tinfo.tms_stime);
+#if HAVE_MALLOC_H & HAVE_SYS_TIMES_H
+  if (trace_flag)
+    {
+      struct mallinfo minfo = mallinfo ();
+      struct tms tinfo;
+      times (&tinfo);
+      fprintf (stderr, "STAGE: %30s: %9d (%9d): %ldu %lds\n",
+              title,
+              minfo.uordblks, minfo.arena,
+              tinfo.tms_utime, tinfo.tms_stime);
+    }
+#endif
 }
+

 int
 main (int argc, char *argv[])



reply via email to

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