summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlemb <wlemb>2003-04-04 12:28:38 +0000
committerwlemb <wlemb>2003-04-04 12:28:38 +0000
commit2ecd333ec523b33a88384b18af97b91efb967963 (patch)
treed8774671c61883d9099ac2fb38a9bd2441c9fc2f
parent7b104f6a55abbd7b4679cd8a7b581def2d68ad48 (diff)
downloadgroff-2ecd333ec523b33a88384b18af97b91efb967963.tar.gz
Check for stdint.h in C++, not in C.
* aclocal.m4 (GROFF_STDINT_H): New function, * configure.ac: Check for stdint.h with GROFF_STDINT_H instead of AC_CHECK_HEADERS. * configure, src/include/config.hin: Regenerated. * src/libs/libgroff/tmpname.cc: Use HAVE_CC_STDINT_H. * src/libs/libgroff/maxfilename.cc: s/HAVE_LIMITS_H/HAVE_CC_LIMITS_H/. * src/roff/troff/node.cc (unbreakable_space_node::tprint): Don't emit word marker.
-rw-r--r--ChangeLog17
-rw-r--r--Makefile.in2
-rw-r--r--aclocal.m411
-rwxr-xr-xconfigure54
-rw-r--r--configure.ac3
-rw-r--r--src/include/config.hin3
-rw-r--r--src/libs/libgroff/maxfilename.cc6
-rw-r--r--src/libs/libgroff/tmpname.cc4
-rw-r--r--src/roff/troff/node.cc2
9 files changed, 91 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f371f47..331eb0e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2003-04-04 Werner LEMBERG <wl@gnu.org>
+
+ Check for stdint.h in C++, not in C.
+
+ * aclocal.m4 (GROFF_STDINT_H): New function,
+ * configure.ac: Check for stdint.h with GROFF_STDINT_H instead of
+ AC_CHECK_HEADERS.
+ * configure, src/include/config.hin: Regenerated.
+ * src/libs/libgroff/tmpname.cc: Use HAVE_CC_STDINT_H.
+
+
+ * src/libs/libgroff/maxfilename.cc:
+ s/HAVE_LIMITS_H/HAVE_CC_LIMITS_H/.
+
+ * src/roff/troff/node.cc (unbreakable_space_node::tprint): Don't
+ emit word marker.
+
2003-04-03 Sergey A. Osokin <osa@freebsd.org.ru>
* man/roff.man: Small fixes.
diff --git a/Makefile.in b/Makefile.in
index feefe7f7..795f633f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -220,7 +220,7 @@ make_install_html=@make_install_html@
# -DHAVE_CC_LIMITS_H if you have a C++ <limits.h>
# -DHAVE_MATH_H if you have <math.h>
# -DHAVE_CC_OSFCN_H if you have a C++ <osfcn.h>
-# -DHAVE_STDINT_H if you have <stdint.h>
+# -DHAVE_CC_STDINT_H if you have a C++ <stdint.h>
# -DHAVE_STDLIB_H if you have <stdlib.h>
# -DHAVE_STRING_H if you have <string.h>
# -DHAVE_STRINGS_H if you have <strings.h>
diff --git a/aclocal.m4 b/aclocal.m4
index 5102d316..2457c75c 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -203,6 +203,17 @@ AC_MSG_RESULT(no))
AC_LANG_POP(C++)])dnl
dnl
dnl
+AC_DEFUN(GROFF_STDINT_H,
+[AC_LANG_PUSH(C++)
+AC_MSG_CHECKING([C++ <stdint.h>])
+AC_TRY_COMPILE([#include <stdint.h>],
+[uint32_t x; int32_t y;],
+AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CC_STDINT_H, 1,
+ [Define if you have a C++ <stdint.h>.]),
+AC_MSG_RESULT(no))
+AC_LANG_POP(C++)])dnl
+dnl
+dnl
AC_DEFUN(GROFF_TIME_T,
[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([for declaration of time_t])
diff --git a/configure b/configure
index 5f0b79d1..8dfc37a9 100755
--- a/configure
+++ b/configure
@@ -3459,9 +3459,8 @@ done
-
for ac_header in stdlib.h unistd.h dirent.h limits.h sys/dir.h \
- string.h strings.h math.h stdint.h sys/time.h
+ string.h strings.h math.h sys/time.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -4613,6 +4612,57 @@ 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
+echo "$as_me:$LINENO: checking C++ <stdint.h>" >&5
+echo $ECHO_N "checking C++ <stdint.h>... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdint.h>
+int
+main ()
+{
+uint32_t x; int32_t y;
+ ;
+ 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
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6;
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CC_STDINT_H 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+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
+
+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
+
echo "$as_me:$LINENO: checking for inttypes.h" >&5
echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
diff --git a/configure.ac b/configure.ac
index 74dfa49b..d849198a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,7 +24,7 @@ GROFF_CSH_HACK(SH_SCRIPT_SED_CMD='1s/.*/:/', SH_SCRIPT_SED_CMD='1s/a/a/')
AC_SUBST(SH_SCRIPT_SED_CMD)
dnl checks for headers
AC_CHECK_HEADERS(stdlib.h unistd.h dirent.h limits.h sys/dir.h \
- string.h strings.h math.h stdint.h sys/time.h)
+ string.h strings.h math.h sys/time.h)
GROFF_ISC_SYSV3
GROFF_POSIX
GROFF_SRAND
@@ -41,6 +41,7 @@ GROFF_SYS_NERR
GROFF_SYS_ERRLIST
GROFF_OSFCN_H
GROFF_LIMITS_H
+GROFF_STDINT_H
GROFF_INTTYPES_H
dnl checks for typedefs
GROFF_UNSIGNED_LONG_LONG
diff --git a/src/include/config.hin b/src/include/config.hin
index ff487d26..98441243 100644
--- a/src/include/config.hin
+++ b/src/include/config.hin
@@ -9,6 +9,9 @@
/* Define if you have a C++ <osfcn.h>. */
#undef HAVE_CC_OSFCN_H
+/* Define if you have a C++ <stdint.h>. */
+#undef HAVE_CC_STDINT_H
+
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
diff --git a/src/libs/libgroff/maxfilename.cc b/src/libs/libgroff/maxfilename.cc
index 341cf926..25f55499 100644
--- a/src/libs/libgroff/maxfilename.cc
+++ b/src/libs/libgroff/maxfilename.cc
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 2001, 2003 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -37,9 +37,9 @@ size_t file_name_max(const char *fname)
#else /* not _POSIX_VERSION */
-#ifdef HAVE_LIMITS_H
+#ifdef HAVE_CC_LIMITS_H
#include <limits.h>
-#endif /* HAVE_LIMITS_H */
+#endif /* HAVE_CC_LIMITS_H */
#ifdef HAVE_DIRENT_H
#include <dirent.h>
diff --git a/src/libs/libgroff/tmpname.cc b/src/libs/libgroff/tmpname.cc
index 213b0eea..f867fe06 100644
--- a/src/libs/libgroff/tmpname.cc
+++ b/src/libs/libgroff/tmpname.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
Written by Werner Lemberg (wl@gnu.org)
This file is part of groff.
@@ -48,7 +48,7 @@ extern "C" {
#endif
#endif
-#if HAVE_STDINT_H
+#if HAVE_CC_STDINT_H
# include <stdint.h>
#endif
diff --git a/src/roff/troff/node.cc b/src/roff/troff/node.cc
index 86c51d86..3b349624 100644
--- a/src/roff/troff/node.cc
+++ b/src/roff/troff/node.cc
@@ -5284,8 +5284,6 @@ void unbreakable_space_node::tprint(troff_output_file *out)
out->do_motion();
out->put("N160\n"); // this is &nbsp;
}
- else
- out->word_marker();
out->right(n);
}