-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Fix MSVC compile issue related with ssize_t #2027
Fix MSVC compile issue related with ssize_t #2027
Conversation
I ran a quick find through pcl and this type is only used in the Dinast Grabber cpp file, while using a libusb function, and as expected, they export that type. See http://libusb.sourceforge.net/api-1.0/libusb_8h_source.html line 36 onwards. So what exactly is happening in your case? |
msvc throws error while compiling pcd_io.cpp
hear is the use of ssize_t |
It was introduced on a fairly recent merge. So I would prefer to follow what both MingW and libusb do and copy the snippet below here https://github.com/PointCloudLibrary/pcl/blob/master/io/src/pcd_io.cpp#L59, on the Windows related conditional branch. /* ssize_t is also not available (copy/paste from MinGW) */
#ifndef _SSIZE_T_DEFINED
#define _SSIZE_T_DEFINED
#undef ssize_t
#ifdef _WIN64
typedef __int64 ssize_t;
#else
typedef int ssize_t;
#endif /* _WIN64 */
#endif /* _SSIZE_T_DEFINED */
#endif /* _MSC_VER */ |
That line seems to be included in since release PCL 1.8.1. (PR #1986) |
Scrap what I just said, copy the snippet here https://github.com/PointCloudLibrary/pcl/blob/master/io/include/pcl/io/impl/pcd_io.hpp#L63 . It has to go there because that's where we're exporting this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@UnaNancyOwen Please double check this is compiling and passing the io tests. For the merge, please squash keeping only the commit message from the first commit.
@SergioRAgostinho It can be built successfully.
Note: test_grabbers result of pcl-1.8.1 tag
|
It is strange. I ran that test too on Visual Studio 2017:
|
@denix56 What do you use updated version of Visual Studio 2017? What is version numbers of x? (15.x) |
@denix56 @SergioRAgostinho Sorry, I tried test again. It all succeeded. I think ready to merge this pull request. Thanks,
|
Fix MSVC compile issue related with ssize_t
The issue is caused because in MSVC the gnu ssize_t type is called SSIZE_T
Maintainer edit: Fixes #2023.