Closed GoogleCodeExporter closed 9 years ago
That last sentence was poorly worded. I was trying to enumerate three distinct
approaches: (1) switch from ssize_t to ptrdiff_t, (2) use appropriate
include/typedef of SSIZE_T, or (3) revert part of r77 i.e. switch back from
ssize_t to int. Again, I have no preference or recommendation.
Original comment by jsbell@chromium.org
on 29 Jul 2013 at 10:03
Hm, breaking MSVC is unfortunate. I'd prefer typedef-ing to SSIZE_T, I guess
(#3 would revert the performance benefit, and #1 is kind of ugly).
The usual way of doing this would simply be adding AC_TYPE_SSIZE_T to
configure.ac. However, I guess MSVC doesn't use the autoconf machinery anyway,
so that wouldn't be too useful for you? I'm reluctant to check for _MSC_VER;
I'd like to minimize those as much as possible.
Suggestions? What does Chromium do for MSVC+Snappy in general?
Original comment by se...@google.com
on 30 Jul 2013 at 9:23
Chromium has "generated" mac/win/linux versions of snappy-stubs-public.h
checked into the tree under
http://src.chromium.org/viewvc/chrome/trunk/src/third_party/snappy/ - they were
probably autogenerated originally, but are usually hand-tweaked now when the
.in is updated; I had to do that for r76 (iovec).
So... modifying configure.ac may be the way to go; I'm not sure how automagical
it's outputs are but at least we'd have consistent include files between
platforms.
Original comment by jsbell@chromium.org
on 30 Jul 2013 at 6:00
r80 now contains AC_SIZE_T and AC_SSIZE_T in configure.ac. Thus, marking as
fixed; you'll still need to make a definition in your manually-maintained
config.h for MSVC, though.
Original comment by se...@google.com
on 13 Aug 2013 at 12:57
I know I'm late to the party, but we landed here while researching the same
issue. You might want to try:
// Handle missing ssize_t on Windows. Typedef's taken from:
//
https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.a
spx#LONG_PTR
#if defined(_WIN32) || defined(_WIN64)
# if defined(_WIN64)
typedef __int64 LONG_PTR;
# else
typedef long LONG_PTR;
# endif
typedef LONG_PTR SSIZE_T;
typedef SSIZE_T ssize_t;
#endif
Original comment by noloa...@gmail.com
on 30 Jul 2015 at 6:06
Original issue reported on code.google.com by
jsbell@chromium.org
on 29 Jul 2013 at 10:00