sandeepkru / cpp-btree

Automatically exported from code.google.com/p/cpp-btree
Apache License 2.0
0 stars 0 forks source link

Doesn't compile on Windows & Visual Studio, missing ssize_t #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use MSVC 2010 to compile any file using btree.h

What is the expected output? What do you see instead?
Should compile, but fails because ssize_t is not known.

What version of the product are you using? On what operating system?
Windows 7 + MSVC 2010 (with matching SDK)

Please provide any additional information below.

Can be fixed by a patch to btree.h like:

#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif

This should work with MSVC versions >= 2010, older ones might not work anyway 
because of missing C++11 support.

Other issues remain, will open separate issues here for them.

Original issue reported on code.google.com by christop...@gmail.com on 4 Feb 2013 at 1:33

GoogleCodeExporter commented 8 years ago
I had the same in Visual Studio 2010 Update 1. However, it was easily fixed 
replacing all the occurrences of "ssize_t" by "intptr_t".

Original comment by felipe.a...@gmail.com on 8 Feb 2013 at 1:22

GoogleCodeExporter commented 8 years ago
Obs.: I was using the source code v1.0.1

Original comment by felipe.a...@gmail.com on 8 Feb 2013 at 1:24

GoogleCodeExporter commented 8 years ago
intptr_t and ssize_t do not sound like the same kind of type.
That said, I think I like the first solution.

Original comment by josh.mac...@gmail.com on 9 Feb 2013 at 7:07

GoogleCodeExporter commented 8 years ago

Original comment by josh.mac...@gmail.com on 9 Feb 2013 at 7:21

GoogleCodeExporter commented 8 years ago
#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif

I used also this approach but when compiling in VS 2013 I get btree.h(1406): 
error C2118: negative subscript

Original comment by radu.cri...@gmail.com on 21 May 2014 at 8:42