Skip to content

Commit 80f6085

Browse files
authored
Merge pull request #1 from mongodb-forks/apply-windows-ssizet-fix
Applied SERVER-22296 [Snappy-1.1.2 Patch]: fix Windows build for ssize_t
2 parents dc05e02 + e605007 commit 80f6085

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

snappy.cc

+13
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

29+
// MongoDB customization: includes basetsd.h under Windows where SSIZE_T is declared.
30+
#include "mongo/platform/basic.h"
31+
2932
#include "snappy-internal.h"
3033
#include "snappy-sinksource.h"
3134
#include "snappy.h"
@@ -74,6 +77,16 @@
7477
#define SNAPPY_PREFETCH(ptr) (void)(ptr)
7578
#endif
7679

80+
// MongoDB customization: Fixes missing ssize_t under Windows.
81+
// Used in IncrementalCopy and IncrementalCopyFastPath.
82+
// See:
83+
// https://code.google.com/p/snappy/issues/detail?id=79
84+
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx#SSIZE_T
85+
// http://src.chromium.org/viewvc/chrome/trunk/src/third_party/snappy/win32/snappy-stubs-public.h
86+
#if defined(_WIN32)
87+
typedef SSIZE_T ssize_t;
88+
#endif // _WIN32
89+
7790
#include <algorithm>
7891
#include <array>
7992
#include <cstddef>

0 commit comments

Comments
 (0)