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.
Clean up handling of special float values in string.format.

library/string.m:
	Delete old code related to the handling of float special
	values in the Mercury implementation of string.format.

	Delete a commented added in my previous change that is
	incorrect.
Fix printing of special float values in C# grade.

library/string.m:
	In the C# grade, do not append ".0" to a special float
	value when converting it to a string.

tests/hard_coded/write_special_float.exp3:
	Alternative expected output for this for use with the
	Java and C# grades.

NEWS:
	Announce the fix.
Fix a problem that broke install_libgrades on non-Linux systems.

boehm_gc/misc.c:
	GC_setup_mark_lock is only defined if the macro PARALLEL_MARK.
	is defined.  Add the appropriate #ifdef for this.
Fix the behaviour of string.from_char_list in C# and Java grades.

The predicate string.from_char_list and string.from_reverse_char_list should
throw an exception if their input lists contain the null character.  This
was not done for the C# and Java grades for the former, and the C# grade for
the latter.
(This fixes the failure of tests/hard_coded/null_char in the C# grade and
almost fixes it for the Java grade.)

library/string.m:
	Make the above predicates throw an exception if their input lists
	contain the null character.

NEWS:
	Announce the above fix.
Fix a test case failure in the C# grade.

Avoid some warnings during runtests.

tests/hard_coded/write.exp3:
	Update this expected output.

tests/hard_coded/hash_bug.m:
	Do not call an obsolete function.

tests/hard_coded/Mercury.options:
	Do not warn about unresolved polymorphism in a test.
Cleanups for tests/hard_coded.

tests/hard_coded/Mmakefile:
	Only run the target_mlobjs test case in C grades; directly linking
	against an object file isn't possible in the non-C grades.

tests/hard_coded/Mercury.options:
	Suppress irrelevant warnings generated by some tests.

tests/hard_coded/hash_init_bug.m:
	Replace a call to an obsolete function.
Fix the failure of tests/hard_coded/bigtest in the C# grade.

tests/hard_coded/lp.m:
	Add a C# foreign_proc for mkuniq/2.
Fix problems with the Mercury compiler in the C# grade.

Fix some problems that prevent the Mercury compiler building and running in the
C# grade.  "Running" here means that ./mercury_compile --help works; I haven't
tried anything more ambitious (yet).

mdbcomp/shared_utilities.m:
	Add a Mercury definition of unlimit_stack/2 for use by the non-C
	backends.

runtime/mercury.h:
	Do not cause a preprocessor error if we are compiling with high-level
	code and without the Boehm GC if we are using clang.
	We need this on OS X because we include this header when building the
	programs in the util directory and on OS X we will probably be using
	clang rather than GCC.  (Clang and GCC both support the required
	extensions to C here, so this won't be a problem.)
Fix references to ssdb_hooks in C# grades.

The Mono compiler started giving me these errors for references to the
`ssdb_hooks' global from other modules:

Mercury/opts/exception.opt(365,15): error CS0103:
The name `ssdb_hooks' does not exist in the current context

library/exception.m:
	Qualify references to `ssdb_hooks' symbol.
Fix a problem with the runtests target in the C# grade.

Mmake.workspace:
	Don't pass the static archives for the Mercury libraries via --link-object
	(MLOBJS) when building compiler executables and test cases in the C# grade.
	The origin of this setting was (probably) the old il grade; it doesn't
	make sense for the csharp grade however and prevents the test suite from
	working properly in that grade.
More work on running the test suite in non-C grades.

Mmake.workspace:
	Do not set MLOBJS in the java and erlang grades.

tests/warnings/singleton_text.exp[234]:
tests/warnings/warn_succ_ind.exp[234]:
	Update these expected outputs to conform to changes to both the file
	generating the warning and also to the way the Mercury compiler prints
	them.
Fix a typo in the configure script.

configure.ac:
	Add a missing '=' character in a variable assignment.
Add support for weak pointers to the C RTS

A weak pointer (aka weak reference) is a pointer to some garbage collector
(GC) allocated object or memory that is not considered by the GC when
deciding if the object is garbage or not.  Additionally, if the object is
reclaimed by the GC the GC will zero-out this pointer so that other code can
test if this object is still available.  Weak pointer can be useful when
implementing caches or cyclic data structures (my motivation for this
change).

This change introduces a weak pointer type (a typedef) in Mercury's runtime
system for the C backends.  Two macros are provided to create and deference
these weak pointers.  Extra documentation, and constraints on how these can
be used are described in mercury_memory.h.

runtime/mercury_memory.c:
runtime/mercury_memory.h:
    As above.

tests/general/weak_ptr.m:
tests/general/Mmakefile:
    Add a test for the C RTS's weak pointer support

tests/general/weak_ptr.exp:
    Expected output for the test.  This isn't the real program's output.
    weak_ptr's output is too volatile to use reliably (see weak_ptr.m).
Use C's 'const' keyword correctly in version_array.m

library/version_array.m:
    Use pointers to constant structures rather than constant pointers to
    structures.
Make version_array's rewind code use constant stack space.

Although rewinding version arrays should be rare it is better if this code
uses constant stack space to avoid crashes.  Currently the list of updates
made in a version array is kept in a singly linked list.  This list needs to
be walked backwards to unwind updates, such as when updating an old version
of an array (to fork into two separate arrays).  The stack is used to
perform this backwards work and can overflow for long histories.

This patch makes these lists doubly-linked so that they can be traversed in
either direction.  The back pointers are implemented using weak pointers in
all backends.  This avoids unnecessary memory retention when a programmer
only maintains a reference to the lastest version of the array, which is the
common case.

library/version_array.m:
    As above; I developed this algorithm in the C implementation first and
    then replicated the changes in the Java and C# implementations.

tests/hard_coded/version_array_test.m:
tests/hard_coded/version_array_test.exp:
    Extend the test case to exercise implicitly unwinding a version array by
    updating an old version of an array.  Note that the implicit and
    explicit unwind codepaths are different as they are out-of-place and
    in-place respectively.