From: Sascha Wildner Date: Tue, 19 Jun 2018 18:49:12 +0000 (+0200) Subject: diffutils: Reconfigure and revert some obsolete local changes. X-Git-Tag: v5.5.0~490 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/f36403318f315ebc8929af83c3e722ffc2cefccf diffutils: Reconfigure and revert some obsolete local changes. Our wcwidth() is by now capable of handling UTF-8 so revert the changes from d76863bd1dbf9c1e4c04a977e3a7271a23cdb718. While here, remove two more files from libdiffutils' Makefile. --- diff --git a/contrib/diffutils/README.DRAGONFLY b/contrib/diffutils/README.DRAGONFLY index c99f3156eb..86131b7cbc 100644 --- a/contrib/diffutils/README.DRAGONFLY +++ b/contrib/diffutils/README.DRAGONFLY @@ -15,5 +15,3 @@ Local modifications applied to following files: src/diff.c src/diff3.c src/sdiff.c - src/side.c - lib/wcwidth.c diff --git a/contrib/diffutils/lib/wcwidth.c b/contrib/diffutils/lib/wcwidth.c index 588e8de878..253fcaa656 100644 --- a/contrib/diffutils/lib/wcwidth.c +++ b/contrib/diffutils/lib/wcwidth.c @@ -18,7 +18,6 @@ /* Specification. */ #include -#include /* Get iswprint. */ #include @@ -28,7 +27,8 @@ #include "uniwidth.h" int -special_wcwidth (wchar_t wc) +wcwidth (wchar_t wc) +#undef wcwidth { /* In UTF-8 locales, use a Unicode aware width function. */ const char *encoding = locale_charset (); diff --git a/contrib/diffutils/src/side.c b/contrib/diffutils/src/side.c index 4b1485aebd..284d960212 100644 --- a/contrib/diffutils/src/side.c +++ b/contrib/diffutils/src/side.c @@ -23,7 +23,6 @@ #include "diff.h" #include -#include static void print_sdiff_common_lines (lin, lin); static void print_sdiff_hunk (struct change *); @@ -139,7 +138,7 @@ print_half_line (char const *const *line, size_t indent, size_t out_bound) if (0 < bytes && bytes < (size_t) -2) { - int width = special_wcwidth (wc); + int width = wcwidth (wc); if (0 < width) in_position += width; if (in_position <= out_bound) diff --git a/gnu/usr.bin/diff/libdiffutils/Makefile b/gnu/usr.bin/diff/libdiffutils/Makefile index ef825b9577..972c9850b1 100644 --- a/gnu/usr.bin/diff/libdiffutils/Makefile +++ b/gnu/usr.bin/diff/libdiffutils/Makefile @@ -80,9 +80,7 @@ SRCS= allocator.c \ cmpbuf.c \ prepargs.c \ asnprintf.c \ - dup2.c \ error.c \ - fcntl.c \ fnmatch.c \ getopt.c \ getopt1.c \ @@ -92,8 +90,7 @@ SRCS= allocator.c \ secure_getenv.c \ strerror.c \ strerror-override.c \ - vasnprintf.c \ - wcwidth.c + vasnprintf.c # sources that produces empty objects #SRCS+= \ diff --git a/gnu/usr.bin/diff/libdiffutils/config.h b/gnu/usr.bin/diff/libdiffutils/config.h index 8d02791d44..f669855c31 100644 --- a/gnu/usr.bin/diff/libdiffutils/config.h +++ b/gnu/usr.bin/diff/libdiffutils/config.h @@ -609,7 +609,7 @@ /* #undef HAVE_NDIR_H */ /* Define to 1 if you have the `newlocale' function. */ -/* #undef HAVE_NEWLOCALE */ +#define HAVE_NEWLOCALE 1 /* Define to 1 if you have the `nl_langinfo' function. */ #define HAVE_NL_LANGINFO 1 @@ -649,7 +649,7 @@ /* #undef HAVE_RAW_DECL_DUP3 */ /* Define to 1 if duplocale is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_DUPLOCALE */ +#define HAVE_RAW_DECL_DUPLOCALE 1 /* Define to 1 if endusershell is declared even after undefining macros. */ #define HAVE_RAW_DECL_ENDUSERSHELL 1 @@ -709,7 +709,7 @@ #define HAVE_RAW_DECL_FTRUNCATE 1 /* Define to 1 if futimens is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_FUTIMENS */ +#define HAVE_RAW_DECL_FUTIMENS 1 /* Define to 1 if getcwd is declared even after undefining macros. */ #define HAVE_RAW_DECL_GETCWD 1 @@ -808,7 +808,7 @@ #define HAVE_RAW_DECL_MBSINIT 1 /* Define to 1 if mbsnrtowcs is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_MBSNRTOWCS */ +#define HAVE_RAW_DECL_MBSNRTOWCS 1 /* Define to 1 if mbsrtowcs is declared even after undefining macros. */ #define HAVE_RAW_DECL_MBSRTOWCS 1 @@ -841,10 +841,10 @@ #define HAVE_RAW_DECL_MKNODAT 1 /* Define to 1 if mkostemp is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_MKOSTEMP */ +#define HAVE_RAW_DECL_MKOSTEMP 1 /* Define to 1 if mkostemps is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_MKOSTEMPS */ +#define HAVE_RAW_DECL_MKOSTEMPS 1 /* Define to 1 if mkstemp is declared even after undefining macros. */ #define HAVE_RAW_DECL_MKSTEMP 1 @@ -865,7 +865,7 @@ #define HAVE_RAW_DECL_PIPE 1 /* Define to 1 if pipe2 is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_PIPE2 */ +#define HAVE_RAW_DECL_PIPE2 1 /* Define to 1 if popen is declared even after undefining macros. */ #define HAVE_RAW_DECL_POPEN 1 @@ -1069,7 +1069,7 @@ #define HAVE_RAW_DECL_USLEEP 1 /* Define to 1 if utimensat is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_UTIMENSAT */ +#define HAVE_RAW_DECL_UTIMENSAT 1 /* Define to 1 if vdprintf is declared even after undefining macros. */ #define HAVE_RAW_DECL_VDPRINTF 1 @@ -1081,10 +1081,10 @@ #define HAVE_RAW_DECL_WAITPID 1 /* Define to 1 if wcpcpy is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_WCPCPY */ +#define HAVE_RAW_DECL_WCPCPY 1 /* Define to 1 if wcpncpy is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_WCPNCPY */ +#define HAVE_RAW_DECL_WCPNCPY 1 /* Define to 1 if wcrtomb is declared even after undefining macros. */ #define HAVE_RAW_DECL_WCRTOMB 1 @@ -1132,7 +1132,7 @@ #define HAVE_RAW_DECL_WCSNLEN 1 /* Define to 1 if wcsnrtombs is declared even after undefining macros. */ -/* #undef HAVE_RAW_DECL_WCSNRTOMBS */ +#define HAVE_RAW_DECL_WCSNRTOMBS 1 /* Define to 1 if wcspbrk is declared even after undefining macros. */ #define HAVE_RAW_DECL_WCSPBRK 1 @@ -1479,7 +1479,7 @@ #define HAVE_WORKING_VFORK 1 /* Define to 1 if you have the header file. */ -/* #undef HAVE_XLOCALE_H */ +#define HAVE_XLOCALE_H 1 /* Define to 1 if extending the stack slightly past the limit causes a SIGSEGV, and an alternate stack can be established with sigaltstack, and @@ -1502,7 +1502,7 @@ /* #undef HAVE___SECURE_GETENV */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST +#define ICONV_CONST /* Define to a symbolic name denoting the flavor of iconv_open() implementation. */ @@ -1516,7 +1516,7 @@ #define MALLOC_0_IS_NONNULL 1 /* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */ -#define MAP_ANONYMOUS MAP_ANON +/* #undef MAP_ANONYMOUS */ /* Define if the mbrtowc function has the NULL pwc argument bug. */ /* #undef MBRTOWC_NULL_ARG1_BUG */ @@ -1732,7 +1732,6 @@ /* #undef _NETBSD_SOURCE */ /* The _Noreturn keyword of C11. */ -#if 0 /* _Noreturn defined in later */ #if ! (defined _Noreturn \ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ @@ -1744,7 +1743,6 @@ # define _Noreturn # endif #endif -#endif /* Define to 2 if the system does not provide POSIX.1 features except with diff --git a/gnu/usr.bin/diff/libdiffutils/gnuwidechar.h b/gnu/usr.bin/diff/libdiffutils/gnuwidechar.h deleted file mode 100644 index 83ed5cc1c4..0000000000 --- a/gnu/usr.bin/diff/libdiffutils/gnuwidechar.h +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Works around wcwidth recursive problem while maintaining UTF-8 - * handling functionality. - */ - -#ifndef _GNUWIDECHAR_H_ -#define _GNUWIDECHAR_H_ - -int special_wcwidth(wchar_t); - -#endif /* !_GNUWIDECHAR_H_ */