Closed jeking3 closed 6 years ago
Hi James,
That's a very good question. So far we haven't had the need for adding such version information to the C library, for the reason that we always work towards having everything packaged through https://github.com/NuxiNL/cloudabi-ports in a way that it builds against the latest release of cloudlibc.
Where would you be interested in using this version information? If you want, I can add a couple of __cloudlibc_*__
definitions to one of the core header files, meaning it will be available as long as a single header file is included.
As a prerequisite to adding support in Boost.Random for entropy generation based on a github pull request you submitted 2 years ago, I submitted a pull request into Boost.Predef to detect CloudABI. In your pull request it looks like the API 2 years ago was different than the API as it is today, hence it would seem the need for versioning is real. The predef module would prefer to have major and minor versions, or if you are going to simply use one number for ABI versioning then I would probably just map it to the major version.
Sounds good! I've just added three definitions to cloudlibc header files: __cloudlibc__ == 1
, __cloudlibc_major__ == 0
and __cloudlibc_minor__ == 87
. The two latter will be bumped every time I'm going to do a release from now on. If you want to access them, all you need to do is include at least one standard C header file (e.g., <stddef.h>
).
Would that be sufficient?
Boost.Predef has been updated in https://github.com/boostorg/predef/pull/65
I'm assuming that at some point calls would be added or possibly removed, and one might need preprocessor definitions to understand which version of cloudlibc is available.
I found the following in
include/uv.h
but that file is for event handling:Is this official versioning for the entire library?