CBD-839:  create 2.0.2 branch off of 2.0.1 at 146c965a5aa5da21901209122bde60a8f3a52171

Change-Id: I562aaa5a308959ddb028b40054fdef338dd979cb
Reviewed-on: http://review.couchbase.org/24590
Reviewed-by: Philip Labee <philip@couchbase.com>
Tested-by: Philip Labee <philip@couchbase.com>
Merge branch 'master' into 2.0.2

Not sure why 2.0.2 wasn't branched off of master, but I need those changes.

Change-Id: I1b95d46a16410aa6540427a8d862e666e63cd5a8
Remove reference to no longer existing file win32.c

Backport from master

Change-Id: I165c958213dd120b7fe894cc7a11a64b94698370
Reviewed-on: http://review.couchbase.org/25214
Reviewed-by: Bin Cui <bin.cui@gmail.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
CBD-913: ICU50 rename libaries

Compared to icu4.x, icu5.0 rename the following libraries:
icudata.dll -> icudt.dll
icui18n.dll -> icuin.dll

Change-Id: I932a97b3bc052c8cdfd873af03a24af68c0e24b2
Reviewed-on: http://review.couchbase.org/25247
Reviewed-by: Bin Cui <bin.cui@gmail.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
MB-6657: Use 64 bits type for file offsets on Windows

Windows follows the LLP64 data model:
http://en.wikipedia.org/wiki/LLP64#64-bit_data_models

This means both the int and long int types have a size of 32 bits
regardless if it's a 32 or 64 bits Windows system.

And Windows defines the type off_t as being a signed long integer:
http://msdn.microsoft.com/en-us/library/323b6b3k.aspx

Therefore we can't use off_t on Windows if we deal with files that
can have a size of 2Gb or more.

By using off_t to represent offsets and doing arithmetic operations
on offsets of this type, such operations result in negative values
when they should produce a value larger than 2Gb. Such negative values
are then converted by os_win.c operations into unsigned 32 bits
integers, as 'Offset' members of a structure of type OVERLAPPED.
This means we can end up overwriting previous data from the file
because couchstore opens files in read/write mode (and not in append
only mode) and does "pwrite" operations with an offset stored in
the db record which is of type off_t and gets incremented after every
write operation.

Other databases and VMs use a custom 64 bits integer on Windows to
represent file offsets, rather than the type off_t.

References:

SQLite:

http://www2.sqlite.org/cgi/src/artifact/eabd00b813577d36bd66271cb08dd64ea0589dac
(function seekWinFile for example)

Python:

http://bugs.python.org/issue12517

Erlang:

https://github.com/erlang/otp/blob/2d03ab7ffde828d3b56f8b7738fd0c00d0f5b630/erts/emulator/drivers/win32/win_efile.c#L1048

Change-Id: Ib49ac055e3073480f696576cc17c791d0349b773
Reviewed-on: http://review.couchbase.org/25268
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Sriram Melkote <siri.couchbase@gmail.com>
MB-6657: cs_off_t should be a signed variable

off_t is supposed to be signed

Change-Id: I7c30bea3d534cd01b2d576815f0841bd96e66c23
Reviewed-on: http://review.couchbase.org/25282
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Merge remote-tracking branch 'couchbase/2.0.1' into update

* couchbase/2.0.1:
  MB-6657: cs_off_t should be a signed variable
  MB-6657: Use 64 bits type for file offsets on Windows

Conflicts:
	src/couch_db.c
	src/couch_file_read.c
	src/couch_file_write.c
	src/couch_save.c
	src/internal.h

Change-Id: Ic1c1b79c79368c39806d4bf95ed347a3dce71b9d
Merge branch '2.0.2' into master

Change-Id: I131483ca0bcf2a665245ec775ebfe9057aadcc46