Assume standard strerror_r unless using glibc.

We followed the feature test macros from the Linux man page for
strerror_r to figure out which function we have actually got, but that
only applies when using the GNU C library.  When using any other C
library, we should assume that strerror_r is the POSIX-standard
strerror_r.

Commit 533f5f874f66802040ad5f05bfca2483a6c90297 worked around
this bug for Mac OS X only.

runtime/mercury_runtime_util.c:
	Explicitly include string.h for strerror_r, just in case.

	If __GNU_LIBRARY__ is not defined then assume we have the
	POSIX-standard strerror_r.  Only follow the feature test
	macros otherwise.

	Assign the return values of strerror_r to variables of the
	expected types.  The compiler should warn about conversions
	between integer and pointer types if the detection was wrong.

	Fix argument order in a call to generic_strerror.
Merge branch 'version-14_01-branch'
Single point of control for string.format implementation in C grades.

Provide a single point of control for the choice of implementation of
string.format in the C grades.  This choice is currently made in three
different spots.

library/string.m:
	Define a new macro, ML_USE_SPRINTF, which expands to a Boolean that
	controls which implementation for string.format is used in C grades.
Workaround Linux NTPL TSX bug (Mercury Bug: 334)

New versions of glibc on x86_64 attempt to use the TSX extension of newer
Intel processors.  This converts mutex-protected critical sections into
transactional memory critical sections.  However the implementation appears
to be buggy and the marker lock in Boehm GC causes an assertion to be
triggered.

I've been in contact with the author of the elision code in glibc and have
submitted this workaround to the Boehm GC list.  Until the bug is fixed or
worked-around upstream I'd like to fix it here so I can continue other work.

This is the simpler and more portable workaround suggested by Peter Wang.

boehm_gc/include/private/pthread_support.h:
boehm_gc/pthread_support.c:
    Define GC_setup_mark_lock()  This procedure creates the lock specifying a
    pthread_mutexattr_t structure.  This is used to disable lock elision on
    Linux with glibc 2.19.

boehm_gc/misc.c:
    Call GC_setup_mark_lock() when initialising the collector.
Merge branch 'version-14_01-branch'

+ Workaround Linux NTPL TSX bug (Mercury Bug: 334)
+ Single point of control for string.format implementation in C grades.
Fix string.format with special float values in non-C grades.

The Mercury implementation of string formatting used by the non-C grades did
not handle the various special float values (i.e. nan, inf and -inf) correctly.
For example, nan was with the '%f' conversion specifier was being formatted as
"nan.0".  Similarly, for -inf and inf.

library/string.m:
	In the Mercury implementation of string formatting handle special
	float values correctly.  (We format them as per C99.)

tests/general/string_format_special_floats.{m,exp}:
	Extend this test to cover the capitalized versions of the float
	conversion specifiers.

	Update the formatting of this module.
NEWS:
	Announce the above fix.
Fix the printing of float special values with write_float in C grades.

runtime/mercury_float.c:
	When printing floats, do not append ".0" to nan, inf or -inf.

tests/hard_coded/Mmakefile:
tests/hard_coded/write_float_special.{m,exp,exp2}:
	Add a regression test for the above.

NEWS:
	Announce the above.
Merge branch 'master' into feature-char-lead-trail-surrogate
Merge remote-tracking branch 'remotes/upstream/version-14_01-branch' into feature-char-lead-trail-surrogate