Add missing includes.
stdin/stdout can be a macro, so avoid using an identifier of that name.

 * Caught during Win32 porting.
Remove unneeded includes from Buffer.cc.
Redo the internal dependency handling.  Stop using prl files.

Apparently, the MinGW makefile generator does not read prl files for
libraries listed on the LIBS variable.[1]
[1] http://www.archivum.info/qt-interest@trolltech.com/2009-06/00888/%28Qt-interest%29-qmake-prl-files-on-MinGW-not-working-as-expected.html

The previous project structure was also causing some kind of error with
"qmake -r" on Linux.  For example:
    Failure to open file: /home/rprichard/sourceweb-build/clang-indexer-qmake/../clang-indexer/Makefile
The error goes away when I rerun "qmake -r".  Maybe the problem is that a
qmake "subdir" is not supposed to exist in a sibling directory.  It goes
away with the new code for handling dependencies.

Each directory has a dependencies.cfg file.  The add_dependencies.pri
script parses the file for a project and adds direct dependencies to the
include path.  It looks for indirect dependencies and adds them to the
LIBS variables.

It would have been natural to use recursion in the addDependencies
function, but when I attempted that, something strange happened involving
variables.  At one point, I noticed that when the second instance of a
recursive function returned to the first instance, all of the variables
(local, global, exported, etc) were apparently cleared.  A variable could
be set and read within this new blank environment, but exporting it had no
effect.  The outermost context could read the value of a variable set in
the second instance, but the first instance would see a blank variable.  My
current guess is that I've hit a qmake bug.
Improve libre2's configuration on Windows.

Use _WIN32 instead of WIN32.  WIN32 is not defined in some stricter
dialects (like -std=c++0x).

Define HAVE_PTHREAD and HAVE_RWLOCK for Unix-like targets.  They should be
undefined on Windows.
Improve help output for the index-tool.
Win32 portability: MinGW's C++11 headers lack std::to_string.

This code might be faster than std::to_string in any case.  I suspect
std::to_string is using *printf on at least some targets.
Win32 portability: implement portableRealPath and getPathModTime on Win32.

Unfortunately, this code is still untested.
Include direct.h in clang-indexer's main.cc to provide chdir.
Win32 portability: Add a Win32 version of indexer::Mutex.

MinGW32 does not provide C++11 threading (yet?).  MinGW-w64 might provide
it.  (It might also still be experimental.)
Update a comment in Mutex.h and include <mutex> instead of <chrono>.

This code is probably broken, but unfortunately, there are no working
configurations right now that actually use C++11's std::mutex, so I can't
test it.
Win32 portability: Mark command-line programs with "CONFIG += console".
Win32/OSX portability: Build libbtrace on Linux only.
Win32 portability: Adjust build options for linking against Clang.

 * I don't know why -Wno-enum-compare is needed only for Windows.

 * The driver complains that -fPIC is redundant, so remove it on Windows.
   (Actually, is -fPIC ever needed for code outside a shared-library?)
Win32 portability: implement a Win32 version of indexer::Process.

Unfortunately, this code is untested.  It builds, but sw-clang-indexer
crashes before reaching main().  I think there is an incompatibility
between the prebuilt Qt 4.8.4 binaries and MinGW G++ 4.7.2.

The pipes to/from the daemon process are opened in text mode.  I'm not
entirely sure this is right, but I think the daemon will open its own
pipes in text mode, too.