[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] [PATCH 09/10] drop glib fallback for snprintf/vsnprintf
From: |
Mike Frysinger |
Subject: |
[Nano-devel] [PATCH 09/10] drop glib fallback for snprintf/vsnprintf |
Date: |
Mon, 18 Apr 2016 02:17:44 -0400 |
The gnulib imports handle this for us now.
---
TODO | 4 +-
autogen.sh | 2 +
configure.ac | 32 +--------
m4/Makefile.am | 2 +-
m4/glib-2.0.m4 | 215 --------------------------------------------------------
src/Makefile.am | 2 +-
src/nano.h | 6 --
7 files changed, 8 insertions(+), 255 deletions(-)
delete mode 100644 m4/glib-2.0.m4
diff --git a/TODO b/TODO
index 88bad53..32b6fa3 100644
--- a/TODO
+++ b/TODO
@@ -9,9 +9,7 @@ For the future (no targeted version, catch-all)
- Allow indentation of marked text by spaces as well as tabs?
- Allow indentation to add just enough columns to reach the nearest
multiple of tabsize, rather than always adding tabsize columns?
-- Allow conversion between different character sets. Maybe use glib's
- iconv() if the system's iconv() is inadequate, since we already use
- glib's vsnprintf() if the system lacks vsnprintf()?
+- Allow conversion between different character sets.
- Allow color syntaxes to apply to more than just color, so that we can
e.g. specify a different alternate spell checker depending on which
file type we have open.
diff --git a/autogen.sh b/autogen.sh
index 98ec7ed..ee0e474 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -11,9 +11,11 @@ modules="
isblank
iswblank
regex
+ snprintf-posix
strcase
strcasestr-simple
strnlen
+ vsnprintf-posix
"
# Make sure the local gnulib git repo is up-to-date.
diff --git a/configure.ac b/configure.ac
index 3d837ce..894de6c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,7 +30,10 @@ AC_PREREQ([2.69])
dnl Lie about gnulib features we don't use to speed up & shrink down.
+gl_cv_func_printf_directive_n=yes
gl_cv_func_printf_infinite_long_double=yes
+gl_cv_func_printf_long_double=yes
+gl_cv_func_snprintf_directive_n=yes
dnl Checks for programs.
@@ -424,30 +427,9 @@ int main(void)
dnl Checks for functions.
-AC_CHECK_FUNCS(snprintf vsnprintf)
-
if test "x$enable_utf8" != xno; then
AC_CHECK_FUNCS(iswalnum iswpunct iswspace nl_langinfo mblen mbstowcs
mbtowc wctomb wcwidth)
fi
-
-if test x$ac_cv_func_snprintf = xno; then
- AM_PATH_GLIB_2_0(2.0.0,,
- AC_MSG_ERROR([
-*** snprintf() not found. GLIB 2.x not found either.
-*** You should install the GLIB 2.x library which can
-*** be found at http://ftp.gtk.org/.]),
- glib)
-fi
-
-if test x$ac_cv_func_vsnprintf = xno; then
- AM_PATH_GLIB_2_0(2.0.0,,
- AC_MSG_ERROR([
-*** vsnprintf() not found. GLIB 2.x not found either.
-*** You should install the GLIB 2.x library which can
-*** be found at http://ftp.gtk.org/.]),
- glib)
-fi
-
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for available flags.
@@ -457,7 +439,6 @@ AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"],
[], [])
dnl Checks for library functions.
AC_TYPE_SIGNAL
-AC_FUNC_VPRINTF
dnl Checks for libraries.
@@ -530,13 +511,6 @@ LIBS="$LIBS $CURSES_LIB"
AC_SUBST(CURSES_LIB)
-if test "x$GLIB_CFLAGS" != "x"; then
- CFLAGS="$CFLAGS $GLIB_CFLAGS"
-fi
-if test "x$GLIB_LIBS" != "x"; then
- LDFLAGS="$LDFLAGS $GLIB_LIBS"
-fi
-
if test "x$enable_utf8" != xno && \
test x$CURSES_LIB_WIDE = xyes && \
test x$ac_cv_func_iswalnum = xyes && \
diff --git a/m4/Makefile.am b/m4/Makefile.am
index ba41afd..795ce4c 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -1,4 +1,4 @@
-EXTRA_DIST = ac_define_dir.m4 codeset.m4 gettext.m4 glib-2.0.m4 \
+EXTRA_DIST = ac_define_dir.m4 codeset.m4 gettext.m4 \
glibc21.m4 gnulib-cache.m4 iconv.m4 intdiv0.m4 inttypes_h.m4 \
inttypes.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 \
lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 \
diff --git a/m4/glib-2.0.m4 b/m4/glib-2.0.m4
deleted file mode 100644
index d6413ff..0000000
diff --git a/src/Makefile.am b/src/Makefile.am
index 0884207..f113ccf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,7 +20,7 @@ nano_SOURCES = browser.c \
utils.c \
winio.c
-nano_LDADD = @GLIB_LIBS@ @LIBINTL@ $(top_builddir)/lib/libgnu.a
+nano_LDADD = @GLIB_LIBS@ $(top_builddir)/lib/libgnu.a
install-exec-hook:
cd $(DESTDIR)$(bindir) && rm -f rnano && $(LN_S) nano rnano
diff --git a/src/nano.h b/src/nano.h
index 97fc1b2..7ed9c8c 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -116,12 +116,6 @@
#include <signal.h>
#include <assert.h>
-/* If no vsnprintf(), use the version from glib 2.x. */
-#ifndef HAVE_VSNPRINTF
-#include <glib.h>
-#define vsnprintf g_vsnprintf
-#endif
-
/* If we aren't using ncurses with mouse support, turn the mouse support
* off, as it's useless then. */
#ifndef NCURSES_MOUSE_VERSION
--
2.7.4
[Nano-devel] [PATCH 05/10] drop getdelim/getline fallback functions, Mike Frysinger, 2016/04/18
[Nano-devel] [PATCH 09/10] drop glib fallback for snprintf/vsnprintf,
Mike Frysinger <=
[Nano-devel] [PATCH 06/10] drop isblank/iswblank fallback functions, Mike Frysinger, 2016/04/18
[Nano-devel] [PATCH 10/10] drop wchar.h/wctype.h/stdarg.h checks, Mike Frysinger, 2016/04/18
[Nano-devel] [PATCH 08/10] assume getopt_long support is always available, Mike Frysinger, 2016/04/18
[Nano-devel] [PATCH 04/10] drop various str fallback functions, Mike Frysinger, 2016/04/18
[Nano-devel] [PATCH 03/10] add support for gnulib, Mike Frysinger, 2016/04/18
[Nano-devel] [PATCH 02/10] gettext: update to 0.18.3 release, Mike Frysinger, 2016/04/18
[Nano-devel] [PATCH 07/10] assume regex.h support is always available, Mike Frysinger, 2016/04/18