rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
194 stars 55 forks source link

ssize_t isn't defined on Windows #898

Closed kaie closed 4 years ago

kaie commented 5 years ago

The "signed size_t" type ssize_t is a POSIX type and is unavailable on Windows.

Although cross compilation worked, you're also using ssize_t in the public rnp.h header. You should change that to a portable size type.

ronaldtse commented 5 years ago

@ni4 would you have time to take care of this? Thanks!

ni4 commented 5 years ago

@ronaldtse Sure. The only question is that ssize_t is used in rnp_input_reader_t return type. Should I just change it to int? cc @dewyatt

dewyatt commented 5 years ago

I think we have at least two options:

  1. Change the ssize_t to an int and break the API+ABI. API clients like ruby-rnp could handle this with version checks, but other clients don't have ways of dealing with this that are as straightforward.
  2. Deprecate rnp_input_from_callback, add a new rnp_input_from_callback_ex and an rnp_input_reader_ex_t. Disable compilation of the deprecated stuff on Windows.
ronaldtse commented 5 years ago

Frankly I'm fine with option 1, I don't think we have too much downstream usage yet.

dewyatt commented 5 years ago

Sounds good to me, let's try for option 1.

mkmelin commented 4 years ago

Any update on this? We run into this again now trying to get the libraries building with the Thunderbird build setup.

ronaldtse commented 4 years ago

@mkmelin thanks for raising this again. @ni4 @dewyatt any updates for option 1?

ni4 commented 4 years ago

@ronaldtse @mkmelin Will switch to this task now.