]> Savannah Git Hosting - gnulib.git/log
gnulib.git
8 years agointprops: update doc URLs
Paul Eggert [Tue, 17 Jan 2017 01:21:57 +0000 (17:21 -0800)]
intprops: update doc URLs

* doc/intprops.texi (Integer Range Overflow): Update URLs.

8 years agohost-cpu-c-abi: Add support for armhf, arm64, x32, s390x.
Bruno Haible [Mon, 16 Jan 2017 21:07:51 +0000 (22:07 +0100)]
host-cpu-c-abi: Add support for armhf, arm64, x32, s390x.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Require gl_C_ASM. On x86_64
systems, distinguish x86_64 and x32. On arm systems, distinguish arm,
armhf, arm64, and no longer distinguish arm and armel. On s390x systems,
distinguish s390 and s390x.
* modules/host-cpu-c-abi (Files): Add m4/asm-underscore.m4.
* NEWS: Mention the change regarding 'armel'.

8 years agoupdate from texinfo
Karl Berry [Mon, 16 Jan 2017 15:09:50 +0000 (07:09 -0800)]
update from texinfo

8 years agolocaleinfo: case_folded_counterparts and WEOF
Paul Eggert [Mon, 16 Jan 2017 05:23:34 +0000 (21:23 -0800)]
localeinfo: case_folded_counterparts and WEOF

* NEWS: Document this.
* lib/localeinfo.c (case_folded_counterparts):
First arg is now wint_t, not wchar_t.  This generalizes the
function to also work on WEOF, where it returns 0.

8 years agodfa: port to gcc -fsanitize=undefined
Paul Eggert [Mon, 16 Jan 2017 01:18:10 +0000 (17:18 -0800)]
dfa: port to gcc -fsanitize=undefined

* lib/dfa.c (copy): Don’t pass NULL with size 0 to memcpy,
as this runs afoul of gcc -fsanitize=undefined.

8 years agostrftime: %z is -00 if unknown
Paul Eggert [Sat, 14 Jan 2017 19:35:34 +0000 (11:35 -0800)]
strftime: %z is -00 if unknown

* lib/strftime.c (DO_TZ_OFFSET): Omit arg 'negative'; it's now
the caller's responsibility to set 'negative_number'.  All uses changed.
(__strftime_internal): Put '-' before a zero UTC offset if the time
zone abbreviation starts with "-", which is the recently-introduced
tzdb convention for an unknown UTC offset that is arbitrarily set to 0.
* tests/test-strftime.c: Test for this.

8 years agodfa: port to older GCC
Paul Eggert [Tue, 10 Jan 2017 22:35:34 +0000 (14:35 -0800)]
dfa: port to older GCC

Problem reported by Assaf Gordon in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00103.html
* modules/c99: New module.  This merely attempts to use the latest
C version, which should be enough to solve this particular problem.
The idea is to document which Gnulib modules assume C99 or later.
* modules/dfa (Depends-on): Add it.

8 years agoUpdate DEPENDENCIES.
Bruno Haible [Tue, 10 Jan 2017 20:57:15 +0000 (21:57 +0100)]
Update DEPENDENCIES.

* DEPENDENCIES: List only https URLs. Update recommended version for
autoconf, automake, gperf.

8 years agomaint.mk: enforce spelling of "timestamp" (i.e., no space)
Jim Meyering [Tue, 10 Jan 2017 15:19:02 +0000 (07:19 -0800)]
maint.mk: enforce spelling of "timestamp" (i.e., no space)

* top/maint.mk (prohibit_undesirable_word_seq_RE_): Also
disallow /\btime\s+stamps?\b/.  Prefer "timestamp".

8 years agodfa: minor simplification with emptyset
Paul Eggert [Tue, 10 Jan 2017 09:27:44 +0000 (01:27 -0800)]
dfa: minor simplification with emptyset

* lib/dfa.c (build_state): Simplify by using emptyset.

8 years agodfa: shrink constraints from 4 bits to 3
Paul Eggert [Tue, 10 Jan 2017 06:48:46 +0000 (22:48 -0800)]
dfa: shrink constraints from 4 bits to 3

* lib/dfa.c (newline_constraint, letter_constraint)
(other_constraint, prev_newline_dependent)
(prev_letter_dependent, NO_CONSTRAINT, BEGLINE_CONSTRAINT)
(ENDLINE_CONSTRAINT, BEGWORD_CONSTRAINT, ENDWORD_CONSTRAINT)
(LIMWORD_CONSTRAINT, NOTLIMWORD_CONSTRAINT):
Constraints need only 3 bits, not 4.  Using smaller integers
shrinks the code a bit and makes grep a tad faster on x86-64.

8 years agodfa: omit unnecessary ptrdiff_t check
Paul Eggert [Tue, 10 Jan 2017 04:28:11 +0000 (20:28 -0800)]
dfa: omit unnecessary ptrdiff_t check

* lib/dfa.c (alloc_position_set): Do not worry about ptrdiff_t
overflow, since xnmalloc does that now.

8 years agodfa: omit unnecessary allocation
Paul Eggert [Tue, 10 Jan 2017 04:26:02 +0000 (20:26 -0800)]
dfa: omit unnecessary allocation

* lib/dfa.c (dfaanalyze): Do not allocate follow set, since
an all-zero follow set works just fine.

8 years agodfa: omit unused local
Paul Eggert [Tue, 10 Jan 2017 00:30:41 +0000 (16:30 -0800)]
dfa: omit unused local

* lib/dfa.c (build_state): Fix up recent change.

8 years agomaint: time stamp -> timestamp
Paul Eggert [Mon, 9 Jan 2017 19:55:22 +0000 (11:55 -0800)]
maint: time stamp -> timestamp

Use the spelling "timestamp", as that is what POSIX uses.

8 years agomaint: remove stray .texi files
Paul Eggert [Mon, 9 Jan 2017 19:49:35 +0000 (11:49 -0800)]
maint: remove stray .texi files

Although these were superseded by other files like
doc/posix-functions/ctime.texi, the old files were not removed.
* doc/ctime.texi, doc/inet_ntoa.texi: Remove.

8 years agogetprogname: fix port to IRIX
Paul Eggert [Mon, 9 Jan 2017 06:10:58 +0000 (22:10 -0800)]
getprogname: fix port to IRIX

* lib/getprogname.c (getprogname) [__sgi]:
Don't dump core if malloc returns NULL.

8 years agodfa: melt down dfastate into build_state
Norihiro Tanaka [Sun, 8 Jan 2017 23:21:21 +0000 (08:21 +0900)]
dfa: melt down dfastate into build_state

* src/dfa.c (dfastate): Remove it.
(build_state): Insert content of dfastate() to bottom.

8 years agodfa: simplify transition table allocation
Norihiro Tanaka [Sun, 8 Jan 2017 22:46:13 +0000 (07:46 +0900)]
dfa: simplify transition table allocation

* src/dfa.c (realloc_trans_if_necessary): Remove second argument.
Its value is derived from other variable.  Update callers.
(dfastate): Remove calculation of max number of state.

8 years agodfa: fix reallocation bug when matching newlines
Paul Eggert [Sun, 8 Jan 2017 20:44:29 +0000 (12:44 -0800)]
dfa: fix reallocation bug when matching newlines

Problem reported for sed by S. Gilles (Bug#25390).
* lib/dfa.c (realloc_trans_if_necessary): Move earlier.
(dfastate): Reallocate before moving any newline transition ...
(build_state): ... instead of reallocating here, where it is too late.

8 years agoAvoid -Wundef warning about undefined WINDOWS_SOCKETS.
Tim Rühsen [Sat, 7 Jan 2017 17:12:52 +0000 (18:12 +0100)]
Avoid -Wundef warning about undefined WINDOWS_SOCKETS.

* lib/sockets.h: Test if WINDOWS_SOCKETS is defined.

8 years agoAvoid -Wundef warning about undefined __USE_FILE_OFFSET64.
Tim Rühsen [Sat, 7 Jan 2017 17:10:48 +0000 (18:10 +0100)]
Avoid -Wundef warning about undefined __USE_FILE_OFFSET64.

* lib/glob-libc.h: Test if __USE_FILE_OFFSET64 is defined.

8 years agostdioext: Port to Minix 3.2 and newer.
Bruno Haible [Sat, 7 Jan 2017 13:49:10 +0000 (14:49 +0100)]
stdioext: Port to Minix 3.2 and newer.

* lib/stdio-impl.h: Treat __minix like the newest NetBSD.
* lib/fseeko.c (fseeko): Likewise.
Reported by Nelson Beebe via Paul Eggert.

8 years agogetprogname: port to IRIX
Paul Eggert [Sat, 7 Jan 2017 00:14:21 +0000 (16:14 -0800)]
getprogname: port to IRIX

* lib/getprogname.c (getprogname): Port to IRIX.
Based on an idea by Bastien Roucariès at:
http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00096.html
via code from Bruno Haible at:
https://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00249.html

8 years agolocalename-tests: port to NetBSD 7
Paul Eggert [Fri, 6 Jan 2017 22:14:43 +0000 (14:14 -0800)]
localename-tests: port to NetBSD 7

Problem reported by Nelson H. F. Beebe.
* tests/test-localename.c:
Test newlocale and uselocale only if both exist.

8 years agoglob, intprops, xalloc: work around Clang bug
Paul Eggert [Fri, 6 Jan 2017 21:36:57 +0000 (13:36 -0800)]
glob, intprops, xalloc: work around Clang bug

Work around LLVM bug 16404, which is still not fixed.
https://llvm.org/bugs/show_bug.cgi?id=16404
Problem reported by Nelson H. F. Beebe.
* lib/glob.c, lib/intprops.h, lib/xalloc-oversized.h (__has_builtin):
Remove.
* lib/glob.c (size_add_wrapv):
* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW, _GL_HAS_BUILTIN_OVERFLOW_P):
* lib/xalloc-oversized.h (xalloc_oversized):
Do not use overflow builtins if Clang.

8 years agodfa: fix 'return' typo
Paul Eggert [Fri, 6 Jan 2017 20:49:39 +0000 (12:49 -0800)]
dfa: fix 'return' typo

Problem reported by Nelson H. F. Beebe.
* lib/dfa.c (merge): Fix typo that Sun compilers rejected.

8 years agolock tests: Prefer semaphore over mutex.
Bruno Haible [Thu, 5 Jan 2017 22:49:34 +0000 (23:49 +0100)]
lock tests: Prefer semaphore over mutex.

* tests/test-lock.c (USE_SEMAPHORE): New constant.
(struct atomic_int, init_atomic_int, get_atomic_int_value,
set_atomic_int_value) [USE_SEMAPHORE]: Define using a POSIX semaphore.
Suggested by Torvald Riegel <triegel@redhat.com>.

8 years agoparse-datetime: fix generated paths for coverage files
Pádraig Brady [Tue, 3 Jan 2017 00:52:13 +0000 (00:52 +0000)]
parse-datetime: fix generated paths for coverage files

* modules/parse-datetime: Adjust the paths for parse-datetime.y
within parse-datetime.c, so that gcc generates appropriate .gcno
files, allowing lcov to proceed without error.  Previously it
would error trying to find "lib/lib/parse-datetime.y".

8 years agomaint.mk: support parallel execution of coverage
Pádraig Brady [Mon, 2 Jan 2017 21:31:49 +0000 (21:31 +0000)]
maint.mk: support parallel execution of coverage

* top/maint.mk (coverage): Run dependencies serially,
thus supporting parallel processing of each one,
particularly build-coverage, which builds and runs tests.

8 years agolock: Provide guarantee to avoid writer starvation for rwlocks.
Bruno Haible [Thu, 5 Jan 2017 11:51:36 +0000 (12:51 +0100)]
lock: Provide guarantee to avoid writer starvation for rwlocks.

The rationale is: 1) Read-preferring read-write locks are prone to
writer starvation if the number of reader threads multiplied by the
percentage of time they have the lock held is too high. 2) Write-
preferring read-write locks are the only reliable way to avoid this.
3) There have been reports of 'test-lock' hanging on glibc systems
http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00009.html,
and glibc indeed implements read-preferring rwlocks by default, see
http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html
and https://sourceware.org/bugzilla/show_bug.cgi?id=13701 .

* m4/pthread_rwlock_rdlock.m4: New file.
* m4/lock.m4 (gl_LOCK): Invoke gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER.
* lib/glthread/lock.h [USE_POSIX_THREADS]: Test
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation
of rwlock initialization on glibc systems without
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation
of rwlocks altogether on non-glibc systems without
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER.
[USE_PTH_THREADS]: Use a different implementation of rwlocks altogether.
* lib/glthread/lock.c [USE_POSIX_THREADS]
(glthread_rwlock_init_for_glibc): New function.
[USE_POSIX_THREADS] (glthread_rwlock_rdlock_multithreaded): Update
comment.
[USE_PTH_THREADS]: New implementation of rwlocks.
[USE_WINDOWS_THREADS] (glthread_rwlock_rdlock_func): Prefer writers over
readers.
* modules/lock (Files): Add m4/pthread_rwlock_rdlock.m4.
(Depends-on): Add 'extensions'.
* tests/test-rwlock1.c: New file.
* lock-tests (Files): Add it.
(Depends-on): Add usleep.
(Makefile.am): Add test-rwlock1 to the tests.

8 years agothread: Fix pth port.
Bruno Haible [Thu, 5 Jan 2017 10:04:52 +0000 (11:04 +0100)]
thread: Fix pth port.

* lib/glthread/thread.h (pth_init): Declare weak.
(glthread_create, glthread_sigmask, glthread_join, gl_thread_self,
gl_thread_exit): Make sure Pth is initialized before invoking any Pth
function.

8 years agoparse-datetime: fix debug message on lone year number
Assaf Gordon [Thu, 5 Jan 2017 04:22:22 +0000 (23:22 -0500)]
parse-datetime: fix debug message on lone year number

Input dates such as
  date -d "Apr 11 22:59:00 2011"
are parsed as date (Apr 11, with default year 2016), then time, then a
number (2011). Based on the combination of previously seen tokens,
'digits_to_date_time' determines 2011 to be a year value.

This fixes the debug messages to correctly show the updated year.

Before:
    $ date --debug -d 'Apr 11 22:59:00 2011'
    date: parsed date part: (Y-M-D) 2016-04-11
    date: parsed time part: 22:59:00
    date: parsed number part: today/this/now

After:
    $ ./src/date --debug -d 'Apr 11 22:59:00 2011'
    date: parsed date part: (Y-M-D) 2016-04-11
    date: parsed time part: 22:59:00
    date: parsed number part: year: 2011

* lib/parse-datetime.y (struct parser_control): Add 'year_seen',
'debug_year_seen' member fields.
(digits_to_date_time): Update 'year_seen' as needed.
(debug_print_current_time): Inform about year updates.
(parse_datetime2): Initialize year_seen,debug_year_seen member fields.

8 years agoparse-datetime: fix local timezone debug messages
Assaf Gordon [Thu, 5 Jan 2017 04:19:51 +0000 (23:19 -0500)]
parse-datetime: fix local timezone debug messages

"Local timezones" are strings that affect only DST relative to the
default timezone. The debug messages in parse-datetime.y printed
wrong information when encountering local timezones.

Examples:
Here EET/EEST are time zones ('zone' token, with values +02:00/+03:00):
     TZ=Asia/Tokyo ./src/date --debug -d '2011-12-11 EET'
     TZ=Asia/Tokyo ./src/date --debug -d '2011-06-11 EEST'

When the default timezone relates to the zone strings, EET/EEST are
parsed as local timezones (tLOCAL_ZONE), and only change the DST
value (0/1, respectively):
     TZ=Europe/Helsinki ./src/date --debug -d '2011-12-11 EET'
     TZ=Europe/Helsinki ./src/date --debug -d '2011-06-11 EEST'

* lib/parse-datetime.y (debug_print_current_time): If local timezone was
seen, inform about DST change, don't print actual timezone.
(debug_strfdatetime): If local timezone was seen, use default timezone
(and adjust as needed) instead of using incorrect timezone.
(parse_datetime2): Use correct time-zone source string, and adjust
default timezone as needed.

8 years agoparse-datetime: add debug warning about DST changes
Assaf Gordon [Thu, 5 Jan 2017 04:14:37 +0000 (23:14 -0500)]
parse-datetime: add debug warning about DST changes

Incorrect date arithmetic due to daylight saving time (DST) are a
common (false) bug report in coreutils.
Detect two such cases and print a warning:
1. year/month/day adjustments (performed on 'struct tm'),
   where 'mktime' returns a different isdst value.
2. hour/minute/seconds/ns adjustments (performed on 'time_t'),
   where the result of 'localtime(3)' on the value will return a
   different isdst value.

Note: DST changes could be harmless or unnoticeable.

Examples (with 'TZ=America/New_York'):

Unnoticeable: result is 2016-Dec-14
   $ date -d '2016-06-15 EDT + 6 months' +%b
   Dec

Unnoticeable: result is 2016-Dec-15 11:00:00
   $ date -d '2016-06-15 12:00:00 EDT + 6 months' +%F
   2016-12-15

This is unexpected:
   $ date -d '2016-06-01 EDT + 6 months' +%F
   2016-11-30

The new debug warnings will show:

   $ ./src/date --debug -d '2016-06-01 EDT + 6 months' +%F
   ...
   date: warning: daylight saving time changed after date adjustment
   ...

* lib/parse-datetime.y (parse_datetime2): Detect DST changes, and print
an appropriate warning message.

8 years agoparse-datetime: add debug warning about date arithmetic
Assaf Gordon [Thu, 5 Jan 2017 04:11:33 +0000 (23:11 -0500)]
parse-datetime: add debug warning about date arithmetic

Date arithmetic are done directly on the fields of 'struct tm',
which can result in invalid dates. Normalization with 'mktime(3)'
will then produce a different date - which might cause unexpected results.

Examples:
  '2016-10-31 - 1 month' => 2016-09-31 normalized to 2016-10-01.
  '2016-02-29 + 1 year'  => 2017-02-29 normalized to 2017-03-01.

Note that date normalization is not inherently wrong and not rejected,
as it has legitimate uses:
  '2016-12-29 + 5 days' => 2016-12-34 noramlized to 2017-01-03.

If the user asked to adjust months but 'mday' changed,
or user asked to adjust years but 'month' changed - warn about it.

    $ ./src/date --debug -d '2016-10-31 - 1 month'
    ...
    date: warning: when adding relative months/years, \
                   it is recommended to specify the 15th of the month
    ...
    date: warning: month/year adjustment resulted in shifted dates:
    date:      adjusted Y M D: 2016 09 31
    date:    normalized Y M D: 2010 10 01
    ...

* lib/parse-datetime.y (parse_datetime2): Detect such cases and print
a warning message. Improve recommendation of when to use 15 of the month
or noon for date arithmetic.

8 years agoparse-datetime: fix debug message of relative part after timezone
Assaf Gordon [Thu, 5 Jan 2017 04:07:12 +0000 (23:07 -0500)]
parse-datetime: fix debug message of relative part after timezone

Relative part (e.g '+8 days') after a timezone string was not reported
(was only reported after a timezone number). Due to the parser's structure,
timezone strings with numbers were handled separately.

before:
     # Timezone number + relative part: OK
     $ ./src/date --debug +%F -d '2013-10-30 00:00:00 +00:00 -8 days'
     ...
     date: parsed relative part: -8 day(s)

     # Timezone string + relative part: missing
     $ ./src/date --debug +%F -d '2013-10-30 00:00:00 UTC -8 days'
     [ missing message ]

After: messages are printed in both cases.

* lib/parse-datetime.y ('zone' token): Call debug_print_relative_time.

8 years agoparse-datetime: fix incorrect debug message on lone number
Assaf Gordon [Thu, 5 Jan 2017 04:02:41 +0000 (23:02 -0500)]
parse-datetime: fix incorrect debug message on lone number

A lone number is an absolute value, not a relative time part.

before:
   $ date --debug -d '20130101'
   date: parsed number part: today/this/now

After:
   $ ./src/date --debug -d '20130101'
   date: parsed number part: (Y-M-D) 2013-01-01

* lib/parse-datetime.y ('item'/'number' tokens): Call
'debug_print_current_time' instead of 'debug_print_relative_time'.

8 years agoexec
Karl Berry [Tue, 3 Jan 2017 17:47:53 +0000 (09:47 -0800)]
exec

8 years agobuild-aux/mdate-sh
Karl Berry [Tue, 3 Jan 2017 17:47:08 +0000 (09:47 -0800)]
build-aux/mdate-sh

8 years agodoc: fix typo in previous change
Paul Eggert [Tue, 3 Jan 2017 01:08:49 +0000 (17:08 -0800)]
doc: fix typo in previous change

8 years agoRevert copyright-year change to synced files
Paul Eggert [Tue, 3 Jan 2017 00:13:17 +0000 (16:13 -0800)]
Revert copyright-year change to synced files

Problem reported by Karl Berry in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00019.html

8 years agodoc: modernize for C11 etc.
Paul Eggert [Tue, 3 Jan 2017 00:05:14 +0000 (16:05 -0800)]
doc: modernize for C11 etc.

* doc/gnulib-readme.texi (Portability guidelines): Modernize a bit
for C11, MinGW, etc.  This responds to Paul Smith's question in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00014.html

8 years agodfa: prefer functions to FETCH_WC macro
Paul Eggert [Mon, 2 Jan 2017 20:22:17 +0000 (12:22 -0800)]
dfa: prefer functions to FETCH_WC macro

* lib/dfa.c (FETCH_WC): Remove, replacing with ...
(fetch_wc, bracket_fetch_wc): ... new functions.  These store the
wint_t result into DFA->lex.wctok instead of to a separate arg.
All callers changed.  Move more local decls closer to where
they're used.

8 years agodfa: narrow more local var scopes
Paul Eggert [Mon, 2 Jan 2017 18:49:17 +0000 (10:49 -0800)]
dfa: narrow more local var scopes

* lib/dfa.c: Move more local decls to be more local.

8 years agodfa: remove duplicate assignment
Paul Eggert [Mon, 2 Jan 2017 16:27:12 +0000 (08:27 -0800)]
dfa: remove duplicate assignment

Problem reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00007.html
* lib/dfa.c (parse_bracket_exp): Simplify.

8 years agodfa: simplify constraint-dependency checking
Paul Eggert [Mon, 2 Jan 2017 05:43:26 +0000 (21:43 -0800)]
dfa: simplify constraint-dependency checking

* lib/dfa.c (prev_newline_constraint, prev_letter_constraint)
(prev_other_constraint): Remove.
(prev_newline_dependent, prev_letter_dependent):
Simplify, to avoid an unnecessary bitwise AND operation.

8 years agodfa: prefer functions and constants to macros
Paul Eggert [Mon, 2 Jan 2017 05:23:18 +0000 (21:23 -0800)]
dfa: prefer functions and constants to macros

* lib/dfa.c: Prefer constants to macros where either will do.
(streq, isasciidigit, newline_constraint)
(letter_constraint, other_constraint, succeeds_in_context)
(prev_newline_constraint, prev_letter_constraint)
(prev_other_constraint, prev_newline_dependent)
(prev_letter_dependent, accepting, accepts_in_context):
Now static functions instead of function-like macros.
Use lower-case names accordingly.  All uses changed.

8 years agodfa: narrow more local var scopes
Paul Eggert [Mon, 2 Jan 2017 04:51:46 +0000 (20:51 -0800)]
dfa: narrow more local var scopes

* lib/dfa.c: Move some more local decls down to nearer where
they're needed.

8 years agodfa: narrow the scope of many local variables
Jim Meyering [Sat, 31 Dec 2016 16:06:24 +0000 (08:06 -0800)]
dfa: narrow the scope of many local variables

* lib/dfa.c: Now that we are no longer constrained to c89, move
declarations of many variables (often indices) "down" into the
scope(s) where used or to the point of definition.  This is a
no-semantic-change diff.

8 years agogettext from dev
Karl Berry [Sun, 1 Jan 2017 17:53:24 +0000 (09:53 -0800)]
gettext from dev

8 years agoversion-etc: new year
Paul Eggert [Sun, 1 Jan 2017 02:59:23 +0000 (02:59 +0000)]
version-etc: new year

* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.

8 years agodo-release-commit-and-tag: avoid shell syntax error
Eric Blake [Sat, 31 Dec 2016 20:44:51 +0000 (14:44 -0600)]
do-release-commit-and-tag: avoid shell syntax error

Tagging during a rebase doesn't make sense, but it at least should
not choke with:

$ ./build-aux/do-release-commit-and-tag 1.4.18 stable
./build-aux/do-release-commit-and-tag: line 146: test: too many arguments
do-release-commit-and-tag: not on branch (no branch, rebasing branch-1.4)

* build-aux/do-release-commit-and-tag (curr_br): $branch can
contain spaces when rebasing.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agomaint.mk: hoist gnulib_dir definition earlier
Eric Blake [Sat, 31 Dec 2016 02:37:10 +0000 (20:37 -0600)]
maint.mk: hoist gnulib_dir definition earlier

Commit 1894933 introduced a temporary warning during all uses of 'make':

Can't open /lib/intprops.h: No such file or directory.

due to an early evaluation of $(shell) prior to the default definition
of $(gnulib_dir).  While that has been fixed in commit ffff79d, hoisting
the definition to the top will prevent further edits from inadvertently
reintroducing the problem.

* top/maint.mk (gnulib_dir): Move near top of file.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agomaint.mk: do not always evaluate intprops-related shell
Jim Meyering [Sat, 31 Dec 2016 09:31:59 +0000 (01:31 -0800)]
maint.mk: do not always evaluate intprops-related shell

* top/maint.mk (_intprops_names): Change := to just "=" to avoid
using gnulib_dir undefined (gnulib_dir is defined later in the
file, which will be fixed separately), and besides, there is no
need to incur the cost of this shell invocation for every single
use of this .mk file.  Reported by Eric Blake in
https://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00137.html

8 years agomaint.mk: improve sc_prohibit_intprops_without_use
Jim Meyering [Fri, 30 Dec 2016 17:01:05 +0000 (09:01 -0800)]
maint.mk: improve sc_prohibit_intprops_without_use

* top/maint.mk (_intprops_names): Don't hard-code the list of
symbol names.  Instead, derive it on the fly.

8 years agodfa: shorten sbit, success
Paul Eggert [Fri, 30 Dec 2016 08:57:21 +0000 (00:57 -0800)]
dfa: shorten sbit, success

* lib/dfa.c (struct regex_syntax.sbit):
(struct dfa.success): Use char, not int, for array elements, since
they are all in the range 0..7.

8 years agodfa: simplify multibyte_prop etc.
Paul Eggert [Fri, 30 Dec 2016 08:42:22 +0000 (00:42 -0800)]
dfa: simplify multibyte_prop etc.

This follows up on a change made when dfa.c was in grep, namely grep
commit c797046c7c13c2647182b919a79a4c5b4ecf82b1
dated 2015-08-12 07:35:03 -0700, which removed unused multibyte support.
That earlier simplification allows for some more simplification
and trimming down here.
* lib/dfa.c (struct mb_char_classes): New member nchars_alloc.
(struct lexer_state): New mamber brack.
(struct dfa, addtok_mb): multibyte_prop elements are now char, not int,
since they must be in the range 0..3 now.
Remove members mbcsets, nmbcsets, mbcsets_alloc, since
the brack member now supersedes them.
(parse_bracket_exp): Update dfa->lex.brack instead of dfa->mbcsets.
(addtok): Use dfa->lex.brack instead of dfa->mbcsets.
(dfaparse): Remove unnecessary initializations of already-0 storage.
(free_mbdata): Free d->lex.brack.chars instead of d->mbcsets.
(dfassbuild): No need to clear sup->mbcsets.

8 years agodfa: minor performance tweak
Paul Eggert [Fri, 30 Dec 2016 07:02:45 +0000 (23:02 -0800)]
dfa: minor performance tweak

* lib/dfa.c (setbit_wc): Test < 0, not == EOF.

8 years agodfa: wrap charclass inside a struct
Paul Eggert [Fri, 30 Dec 2016 05:44:17 +0000 (21:44 -0800)]
dfa: wrap charclass inside a struct

This lets GCC check for aliases more accurately.
On my platform (gcc Ubuntu 5.4.0-6ubuntu1~16.04.4 x86-64,
en_US.utf8 locale) this makes 'grep -Fi -f list.txt list.txt >out'
about 1% faster, where list.txt is generated by 'aspell dump
master | head -n 100000 >list.txt'.  Also, it shrinks the grep
text by 64 bytes, woohoo!  See Bug#22239.
* lib/dfa.c (charclass): Wrap inside a struct.  All uses changed.
(CHARCLASS_INIT, tstbit, setbit, clrbit, zeroset, fillset, notset)
(equal, emptyset, charclass_index, setbit_wc, setbit_case_fold_c):
Adjust to this, e.g., by using charclass * rather than charclass.
All callers changed as needed.
(copyset): Remove.  All uses changed to simple assignment.
(parse_bracket_exp): Use zeroset instead of memset.

8 years agoChangelog: insert omitted word
Jim Meyering [Fri, 30 Dec 2016 08:53:11 +0000 (00:53 -0800)]
Changelog: insert omitted word

8 years agomaint.mk: update list of intprops.h symbol names
Jim Meyering [Fri, 30 Dec 2016 08:42:06 +0000 (09:42 +0100)]
maint.mk: update list of intprops.h symbol names

* top/maint.mk (_intprops_names): Regenerate the list of symbol names.
This avoids a false failure of the sc_prohibit_intprops_without_use
in grep.

8 years agogetopt: fix parallel test failure
Eric Blake [Thu, 29 Dec 2016 21:05:34 +0000 (15:05 -0600)]
getopt: fix parallel test failure

I hit a testsuite failure due to a failure removing test-getopt.tmp,
when running tests in parallel.

* tests/test-getopt-posix.c (TEST_GETOPT_TMP_NAME): Set name.
* tests/test-getopt-gnu.c (TEST_GETOPT_TMP_NAME): Likewise.
* tests/test-getopt-main.h (main): Use different file names
in case test-getopt-gnu and test-getopt-posix run in parallel.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoxalloc: x2nrealloc check for ptrdiff_t overflow
Paul Eggert [Thu, 29 Dec 2016 09:16:51 +0000 (01:16 -0800)]
xalloc: x2nrealloc check for ptrdiff_t overflow

* lib/xalloc.h (x2nrealloc): Check for ptrdiff_t overflow, too.
* modules/xalloc, modules/xvasprintf (Depends-on): Add stdint.

8 years agolock test: Fix performance problem on multi-core machines.
Bruno Haible [Sat, 24 Dec 2016 17:21:59 +0000 (18:21 +0100)]
lock test: Fix performance problem on multi-core machines.

* tests/test-lock.c (USE_VOLATILE): New macro.
(struct atomic_int): New type.
(init_atomic_int, get_atomic_int_value, set_atomic_int_value): New
functions.
(lock_checker_done, rwlock_checker_done, reclock_checker_done): Define
as 'struct atomic_int'.
(lock_checker_thread, test_lock, rwlock_checker_thread, test_rwlock,
reclock_checker_thread, test_recursive_lock): Use the new functions.
Reported by Eric Blake in
https://www.redhat.com/archives/libvir-list/2012-March/msg00854.html
and by Pádraig Brady in
http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00117.html.

8 years agoautoupdate
Karl Berry [Sat, 24 Dec 2016 13:27:13 +0000 (05:27 -0800)]
autoupdate

8 years agovma-iter: Fix endless loop on 64-bit Windows.
Bruno Haible [Mon, 19 Dec 2016 23:18:14 +0000 (00:18 +0100)]
vma-iter: Fix endless loop on 64-bit Windows.

* lib/vma-iter.c (vma_iterate): On Windows, use 'uintptr_t' instead of
'unsigned long'.

8 years agostdint: Fix WINT_MAX to match the gnulib provided wint_t on minw.
Bruno Haible [Mon, 19 Dec 2016 20:12:54 +0000 (21:12 +0100)]
stdint: Fix WINT_MAX to match the gnulib provided wint_t on minw.

* m4/wint_t.m4 (gt_TYPE_WINT_T): Define GNULIB_OVERRIDES_WINT_T here.
* m4/stdint.m4 (gl_STDINT_H): Don't define GNULIB_OVERRIDES_WINT_T.
Invoke gt_TYPE_WINT_T instead.
(gl_STDINT_TYPE_PROPERTIES): Test GNULIB_OVERRIDES_WINT_T.
* modules/stdint (Files): Add m4/wint_t.m4.
* modules/wchar (Makefile.am): Substitute GNULIB_OVERRIDES_WINT_T.
* modules/wctype-h (Makefile.am): Likewise.
* lib/wchar.in.h (wint_t): Override if GNULIB_OVERRIDES_WINT_T is set,
not only on MSVC.
* lib/wctype.in.h (wint_t): Likewise.

8 years agogetopt-posix-tests: fix Makefile typo
Paul Eggert [Mon, 19 Dec 2016 16:20:45 +0000 (08:20 -0800)]
getopt-posix-tests: fix Makefile typo

* modules/getopt-posix-tests (test_getopt_posix_LDADD):
Fix typo: the last ‘_’ was missing in the name.
I suspect that the typo explains this build failure:
https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/39
although I can’t reproduce the problem on Solaris 10 sparc.

8 years agodfa: improve worst-case 'replace' performance
Paul Eggert [Mon, 19 Dec 2016 01:35:19 +0000 (17:35 -0800)]
dfa: improve worst-case 'replace' performance

See my note in Bug#22357#71.
* lib/dfa.c (insert, delete): Rework to avoid duplicate test.
(merge_constrained): New function, which is like
the old 'merge' function, except with a new argument C2.
Simplify the body by avoiding the need for different sections
of code depending on whether one input is exhausted.
(merge): Use the new function.
(delete): Return the constraint of the deleted position,
not the entire position.  Caller changed.
(replace): Change from O(N*(N + log N)) to O(N log N) algorithm.

8 years agodfa: performance improvement for removal of epsilon closure
Norihiro Tanaka [Thu, 15 Dec 2016 00:31:57 +0000 (16:31 -0800)]
dfa: performance improvement for removal of epsilon closure

* lib/dfa.c (delete): Use binary search to find deleted index.
(replace): New function.  It replaces a position with the followed set.
(epsclosure): Replace it with a new algorithm.  Update caller.

8 years agoautoupdate
Karl Berry [Sun, 18 Dec 2016 22:32:40 +0000 (14:32 -0800)]
autoupdate

8 years agoSplit tests for getopt-posix and getopt-gnu.
Bruno Haible [Sun, 18 Dec 2016 13:03:37 +0000 (14:03 +0100)]
Split tests for getopt-posix and getopt-gnu.

* tests/test-getopt-posix.c: New file.
* tests/test-getopt-gnu.c: New file, with code from test-getopt.c.
* tests/test-getopt-main.h: Renamed from tests/test-getopt.c. Remove
stuff moved to test-getopt-gnu.c. Test TEST_GETOPT_GNU instead of
GNULIB_TEST_GETOPT_GNU.
* modules/getopt-posix-tests (Files): Add test-getopt-posix.c,
test-getopt-main.h. Remove test-getopt.c, test-getopt_long.h.
(Makefile.am): Test test-getopt-posix instead of test-getopt.
* modules/getopt-gnu-tests: New file.
* modules/getopt-gnu (configure.ac): Don't define GNULIB_TEST_GETOPT_GNU.

8 years agoposix-modules: Add options for specific platforms.
Bruno Haible [Sat, 17 Dec 2016 10:50:06 +0000 (11:50 +0100)]
posix-modules: Add options for specific platforms.

* posix-modules (func_usage): Document options --for-mingw, --for-msvc.
(exclude_for_mingw, exclude_for_msvc, exclude): New variables.
Invoke func_tmpdir. Filter out the excludes.

8 years agogetopt: Fix link error for users of getopt() in <unistd.h>.
Bruno Haible [Sun, 18 Dec 2016 12:07:43 +0000 (13:07 +0100)]
getopt: Fix link error for users of getopt() in <unistd.h>.

* lib/getopt.in.h (getopt etc.): Do the macro definitions also when
__need_getopt is defined. Undefine all macros before defining them.
* modules/getopt (Include): Clarify that including <unistd.h> is also
OK.
* tests/test-getopt.c: Add comment.

8 years agogetaddrinfo tests: Avoid compilation error on MSVC.
Bruno Haible [Sun, 18 Dec 2016 00:49:50 +0000 (01:49 +0100)]
getaddrinfo tests: Avoid compilation error on MSVC.

* tests/test-getaddrinfo.c: Don't check the prototypes of freeaddrinfo,
getaddrinfo on native Windows.

8 years agogetlogin, getlogin_r: Fix link errors on MSVC.
Bruno Haible [Sat, 17 Dec 2016 23:38:37 +0000 (00:38 +0100)]
getlogin, getlogin_r: Fix link errors on MSVC.

* m4/getlogin.m4 (gl_LIB_GETLOGIN): New macro.
* modules/getlogin (configure.ac): Require gl_LIB_GETLOGIN.
(Link): New section.
* modules/getlogin_r (Files): Add m4/getlogin.m4.
(configure.ac): Require gl_LIB_GETLOGIN.
(Link): New section.
* NEWS: Mention the new link requirements.
* modules/getlogin-tests (test_getlogin_LDADD): New variable.
* modules/getlogin_r-tests (test_getlogin_r_LDADD): New variable.

8 years agoUn-deprecate the 'progname' module.
Bruno Haible [Sat, 17 Dec 2016 23:27:17 +0000 (00:27 +0100)]
Un-deprecate the 'progname' module.

* NEWS: Describe the appropriate use-cases of 'progname' versus
'getprogname'. Based on discussion summary at
http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00105.html

8 years agoReorganize NEWS a bit.
Bruno Haible [Sat, 17 Dec 2016 23:14:59 +0000 (00:14 +0100)]
Reorganize NEWS a bit.

* NEWS: Move some not so important changes away from section
"Important Notes".

8 years agotanhf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 19:51:33 +0000 (20:51 +0100)]
tanhf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_TANHF.
* m4/tanhf.m4 (gl_FUNC_TANHF): Set REPLACE_TANHF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_TANHF.
* lib/math.in.h (tanhf): Override if REPLACE_TANHF is 1.

8 years agotanf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 19:48:34 +0000 (20:48 +0100)]
tanf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_TANF.
* m4/tanf.m4 (gl_FUNC_TANF): Set REPLACE_TANF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_TANF.
* lib/math.in.h (tanf): Override if REPLACE_TANF is 1.

8 years agosqrtf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 19:44:37 +0000 (20:44 +0100)]
sqrtf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_SQRTF.
* m4/sqrtf.m4 (gl_FUNC_SQRTF): Set REPLACE_SQRTF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_SQRTF.
* lib/math.in.h (sqrtf): Override if REPLACE_SQRTF is 1.

8 years agosinhf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 19:41:36 +0000 (20:41 +0100)]
sinhf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_SINHF.
* m4/sinhf.m4 (gl_FUNC_SINHF): Set REPLACE_SINHF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_SINHF.
* lib/math.in.h (sinhf): Override if REPLACE_SINHF is 1.

8 years agosinf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 19:38:33 +0000 (20:38 +0100)]
sinf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_SINF.
* m4/sinf.m4 (gl_FUNC_SINF): Set REPLACE_SINF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_SINF.
* lib/math.in.h (sinf): Override if REPLACE_SINF is 1.

8 years agologf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 19:34:06 +0000 (20:34 +0100)]
logf: Avoid redefinition error on MSVC.

* m4/logf.m4 (gl_FUNC_LOGF): Set REPLACE_LOGF to 1 if the function
may be defined as an inline function.

8 years agolog10l: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 19:32:14 +0000 (20:32 +0100)]
log10l: Avoid redefinition error on MSVC.

* m4/log10l.m4 (gl_FUNC_LOG10L): Set REPLACE_LOG10L to 1 if the function
may be defined as an inline function.

8 years agolog10f: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 19:30:33 +0000 (20:30 +0100)]
log10f: Avoid redefinition error on MSVC.

* m4/log10f.m4 (gl_FUNC_LOG10F): Set REPLACE_LOG10F to 1 if the function
may be defined as an inline function.

8 years agohypotl: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:51:29 +0000 (19:51 +0100)]
hypotl: Avoid redefinition error on MSVC.

* m4/hypotl.m4 (gl_FUNC_HYPOTL): Set REPLACE_HYPOTL to 1 if the function
may be defined as an inline function.

8 years agohypotf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:49:31 +0000 (19:49 +0100)]
hypotf: Avoid redefinition error on MSVC.

* m4/hypotf.m4 (gl_FUNC_HYPOTF): Set REPLACE_HYPOTF to 1 if the function
may be defined as an inline function.

8 years agofmodl: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:47:46 +0000 (19:47 +0100)]
fmodl: Avoid redefinition error on MSVC.

* m4/fmodl.m4 (gl_FUNC_FMODL): Set REPLACE_FMODL to 1 if the function
may be defined as an inline function.

8 years agofmodf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:44:34 +0000 (19:44 +0100)]
fmodf: Avoid redefinition error on MSVC.

* m4/fmodf.m4 (gl_FUNC_FMODF): Set REPLACE_FMODF to 1 if the function
may be defined as an inline function.

8 years agoexpf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:41:12 +0000 (19:41 +0100)]
expf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_EXPF.
* m4/expf.m4 (gl_FUNC_EXPF): Set REPLACE_EXPF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_EXPF.
* lib/math.in.h (expf): Override if REPLACE_EXPF is 1.

8 years agocoshf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:36:54 +0000 (19:36 +0100)]
coshf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_COSHF.
* m4/coshf.m4 (gl_FUNC_COSHF): Set REPLACE_COSHF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_COSHF.
* lib/math.in.h (coshf): Override if REPLACE_COSHF is 1.

8 years agocosf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:31:58 +0000 (19:31 +0100)]
cosf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_COSF.
* m4/cosf.m4 (gl_FUNC_COSF): Set REPLACE_COSF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_COSF.
* lib/math.in.h (cosf): Override if REPLACE_COSF is 1.

8 years agoatan2f: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:26:04 +0000 (19:26 +0100)]
atan2f: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_ATAN2F.
* m4/atan2f.m4 (gl_FUNC_ATAN2F): Set REPLACE_ATAN2F to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_ATAN2F.
* lib/math.in.h (atan2f): Override if REPLACE_ATAN2F is 1.

8 years agoatanf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:21:51 +0000 (19:21 +0100)]
atanf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_ATANF.
* m4/atanf.m4 (gl_FUNC_ATANF): Set REPLACE_ATANF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_ATANF.
* lib/math.in.h (atanf): Override if REPLACE_ATANF is 1.

8 years agoasinf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:15:56 +0000 (19:15 +0100)]
asinf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_ASINF.
* m4/asinf.m4 (gl_FUNC_ASINF): Set REPLACE_ASINF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_ASINF.
* lib/math.in.h (asinf): Override if REPLACE_ASINF is 1.

8 years agoacosf: Avoid redefinition error on MSVC.
Bruno Haible [Sat, 17 Dec 2016 18:08:14 +0000 (19:08 +0100)]
acosf: Avoid redefinition error on MSVC.

* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_ACOSF.
* m4/acosf.m4 (gl_FUNC_ACOSF): Set REPLACE_ACOSF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_ACOSF.
* lib/math.in.h (acosf): Override if REPLACE_ACOSF is 1.

8 years agoAvoid redefinition errors on MSVC.
Bruno Haible [Sat, 17 Dec 2016 15:44:51 +0000 (16:44 +0100)]
Avoid redefinition errors on MSVC.

* m4/snprintf.m4 (gl_REPLACE_SNPRINTF): Set REPLACE_SNPRINTF to 1 if
the function may be defined as an inline function.
* m4/vsnprintf.m4 (gl_REPLACE_VSNPRINTF): Set REPLACE_VSNPRINTF to 1 if
the function may be defined as an inline function.

8 years agoAvoid redefinition errors on MSVC.
Bruno Haible [Sat, 17 Dec 2016 13:16:50 +0000 (14:16 +0100)]
Avoid redefinition errors on MSVC.

* lib/stdio.in.h: Include <stdlib.h> and <io.h> when necessary.
* lib/unistd.in.h: Include <stdio.h> when necessary.