Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Apr 20, 2016 · 5 comments
Open

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 4 Feb 2013 at 1:33

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 8 Feb 2013 at 1:22

@GoogleCodeExporter
Copy link
Author

Obs.: I was using the source code v1.0.1

Original comment by [email protected] on 8 Feb 2013 at 1:24

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 9 Feb 2013 at 7:07

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 9 Feb 2013 at 7:21

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

#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 [email protected] on 21 May 2014 at 8:42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant