MB-9511: Replace use of threadlocal

The old code used a threadlocal storage to stash
away the last errno reported by the operating system.

This patch replace that implementation with one that
pass the the area to store it into the functions.

The motivation for this change is to remove the
the dependency for pthread thread local in the code
for such simple usage of threadlocal..

Change-Id: I57bc1954d877f5fd52481bf7ab1da63e5d901f3e
Reviewed-on: http://review.couchbase.org/30255
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
All supported platforms have strdup

Change-Id: Iefb9e37862975bc491e56dcfa9385bf8d1aa9986
Reviewed-on: http://review.couchbase.org/30290
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
MB-9504: Remove duplicate implementation of ntohll

Change-Id: Id2a27b1a93eadb3130a9038d4508ffaab109ff85
Reviewed-on: http://review.couchbase.org/30293
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
MB-9510: Couchstore compiles with -std=89

There are still lots of warnings, but at least it compiles

Change-Id: I45a61062bfd3af7468d2cac9655faa8aa580d0ec
Reviewed-on: http://review.couchbase.org/30318
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
MB-9510: Less warnings

Only function-unused warnings are left. All other warnings
by GCC and Clang are fixed.

Some warning only showed up in GCC when compiled with -std=c89.

Change-Id: I495d4ce951c3d705936afefa846511dbd5410e40
Reviewed-on: http://review.couchbase.org/30319
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: buildbot <build@couchbase.com>
Conditionally include unistd.h

Change-Id: I19be4ec7486ed29e85c056eabf787a5cf512f502
Reviewed-on: http://review.couchbase.org/30361
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Use remove() instead of the nonstandard unlink()

Change-Id: I5e055b0f9c80550422114498da97210625727643
Reviewed-on: http://review.couchbase.org/30393
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
MB-9310: Build with MSVC

Change-Id: Id4e0275d771e849dcbfc21d52140dc4de33396c5
Reviewed-on: http://review.couchbase.org/30390
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Remove compile warnings from unused static

Replaced "static functions" from the header files with real
function calls which is located in another object file. This
removes a lot of the "unused static" warnings emitted from
a lot of the files in the module.

Change-Id: I2419fcf7947991ee3fb885cabec8bc8d45810c0f
Reviewed-on: http://review.couchbase.org/30409
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Make encode_kv_length bigendian-safe

Change-Id: I7ebc0d6263597b82859419ee573812113b524aad
Reviewed-on: http://review.couchbase.org/30408
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Enable the "new" V8 API for people on Mac with V8 from Homebrew

Change-Id: If7a25f0c7e91c2361ea466b3296a609beb0e8e4c
Reviewed-on: http://review.couchbase.org/30659
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Sarath Lakshman <sarathlakshman@slynux.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Disable the homebrew check for v8

Change-Id: I1c1a832998d7d829d9415ed5ae67f3f6e8c305bb
Reviewed-on: http://review.couchbase.org/30671
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>