-
Notifications
You must be signed in to change notification settings - Fork 126
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
Definition of ssize_t is wrong #39
Comments
Aw crap, I didn't notice that all that stuff is wrapped in @borrrden tells me that the definition on Windows should still be fixed to use the one from the system, because the system one ends up being typedef'd to |
Ha. I saw this and thought, "That must be something new". But I find references to it going back to 2002, so I must have missed something. Sure, I'd much rather use definitions from each system than make them up myself. Just wish Microsoft was more aligned to the rest of the world. |
Done with a1271fb. |
sockpp has its own declaration of
ssize_t
in platform.h, but on non-Windows systems it defines it asint
.This is wrong on 64-bit OSs that use 32-bit ints, which includes all Apple platforms. (Dunno about Linux or BSD.) This leads to compile errors if a source file ends up including both platform.h and the OS's declaration. That aside, there are potentially actual integer overflow bugs if dealing with sizes > 4GB.sockpp/include/sockpp/platform.h
Lines 78 to 86 in 180f18d
You shouldn't need to declare this at all. Instead:
On a POSIX-compliant OS,#include <sys/types.h>
.#include <BaseTsd.h>
and thenusing ssize_t = SSIZE_T;
.(Also, it's kind of icky that the types declared in
platform.h
are all in the global namespace. Could they be put in thesockpp
namespace like the rest of the API?)The text was updated successfully, but these errors were encountered: