summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorwlemb <wlemb>2003-02-15 07:24:03 +0000
committerwlemb <wlemb>2003-02-15 07:24:03 +0000
commit5ea4de444fc02cbd780bb2ffc0274bfad434f6ad (patch)
tree578b680d7d15676e14f1559a38a8fcd2f270ae06 /configure
parente2b4b9428ae54b64192c7a48dd10098eb2f17f3d (diff)
downloadgroff-5ea4de444fc02cbd780bb2ffc0274bfad434f6ad.tar.gz
Add memory management for colors to deallocate unnamed colors
properly. * src/include/color.h (color): New members `free_list' and `next'. New member functions `new' and `delete'. Add deconstructor. * src/libs/libgroff/color.cc: Implement it. * src/libs/libgroff/font.cc (font::add_kern): Use integer cast for array size of new operator. * src/libs/libdriver/input.cc (IntArray::operator[]): Remove redundant comparison. * src/roff/troff/input.cc (word_space_node::reread, hmotion_node::reread): Avoid warning about unused parameter. (reset_output_registers): Remove redundant parameter. (define_color): Undo change 2003-02-12. * src/roff/troff/reg.h: Updated. * src/roff/troff/node.cc (troff_output_file::really_print_line, output_file::put_filename, real_output_file::really_put_filename, ascii_output_file::really_print_line, break_char_node::get_hyphen_list): Avoid warning about unused parameter. (suppress_node::tprint): Updated. * configure.ac: Check declaration for rand() and srand(). * configure: Regenerated. * src/preproc/pic/pic.h: Declare fmod(), rand(), and srand() conditionally. * src/preproc/pic/pic.y: Remove declaration of fmod(), rand(), and srand(). * src/preproc/eqn/delim.cc (delim_table): Add missing initializers to avoid compiler warnings. * src/preproc/grn/hgraph.cc (HGPrintElt): Second parameter is unused. * src/devices/grops/ps.cc (ps_printer::set_char): Last parameter is unused. * src/devices/grops/psrm.cc (skip_possible_newline): Remove first (unused) parameter. Updated all callers. * src/devices/grotty/tty.cc (tty_printer::set_char): Last parameter is unused. * src/devices/grodvi/dvi.cc (dvi_printer::set_char): Ditto. * src/devices/grolj4/lj4.cc (lj4_printer::set_char): Ditto. * src/devices/grohtml/post-html.cc (html_printer::emit_line): Parameter is unused. (html_printer::add_table_end): Define parameter conditionally. * src/devices/grohtml/output.cc (simple_output::special): Parameter is unused. * src/devices/grolbp/lbp.cc: Define _GNU_SOURCE conditionally. (lbp_printer::set_char): Last parameter is unused. * src/utils/indxbib/indxbib.cc (main): Remove redundant comparison.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure160
1 files changed, 160 insertions, 0 deletions
diff --git a/configure b/configure
index 982d93d4..d2f1a912 100755
--- a/configure
+++ b/configure
@@ -4093,6 +4093,166 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking whether rand must be declared" >&5
+echo $ECHO_N "checking whether rand must be declared... $ECHO_C" >&6
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+if test "${groff_cv_decl_needed_rand+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#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
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+int
+main ()
+{
+#ifndef rand
+ char *p = (char *) rand;
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ groff_cv_decl_needed_rand=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+groff_cv_decl_needed_rand=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $groff_cv_decl_needed_rand" >&5
+echo "${ECHO_T}$groff_cv_decl_needed_rand" >&6
+if test $groff_cv_decl_needed_rand = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NEED_DECLARATION_RAND 1
+_ACEOF
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+echo "$as_me:$LINENO: checking whether srand must be declared" >&5
+echo $ECHO_N "checking whether srand must be declared... $ECHO_C" >&6
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+if test "${groff_cv_decl_needed_srand+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#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
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+int
+main ()
+{
+#ifndef srand
+ char *p = (char *) srand;
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ groff_cv_decl_needed_srand=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+groff_cv_decl_needed_srand=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $groff_cv_decl_needed_srand" >&5
+echo "${ECHO_T}$groff_cv_decl_needed_srand" >&6
+if test $groff_cv_decl_needed_srand = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NEED_DECLARATION_SRAND 1
+_ACEOF
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
echo "$as_me:$LINENO: checking whether strcasecmp must be declared" >&5
echo $ECHO_N "checking whether strcasecmp must be declared... $ECHO_C" >&6
ac_ext=cc