We disable:
- the tests (which require glib) although they can be
reactivated with the `--tests` command line flag
- shared library (lack of export symbol declarations
means that although it can be built, no symbol is
exported and therefore it can't be used)
The `install` target installs the library and headers
under the `build` folder, because it's a traditional practice
to move libraries to a central location on Windows, unless
you are using cygwin. In which case pass `prefix` to the
command line.
We adapt tools\windows\build_examples.bat to take the library
that is built using scons or using tools\windows\build.bat
We port registry by importing the (public domain) openbsd implementation
of the tfind/tsearch POSIX binary tree search functions.
These are only necessary when building on non-posix platforms
MSVC was complaining that the `tail` variable was potentially
uninitialized in the while branch. Since the while loop is actually
coupled to the if (head != NULL) that initializes the tail variable,
we move them together, which makes the warning disappear.
Rationale: "Basic allocation" refers to things outside of parsing proper,
mostly initialization. If such allocations fail, the system is globally
emory-starved from which it will likely not recover by returning failure.
In this case, terminating the process is in fact the most robust strategy as
it may mean the difference between a permanent hang and a temporary crash.
Rationale: If memory allocation fails in the inner parse and we
longjump up the stack, the temporary arena will be missed and leak.
NB: This change means that any allocations done by the continuation
(in the form of new parsers, probably) will persist for the
lifetime of the parse result. Beware of wasting too much memory
this way! The bind continuation should generally keep dynamic
allocations to a minimum.