Skip to content
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

Export HS_VERSION in the public include files #222

Open
vstakhov opened this issue Feb 27, 2020 · 3 comments
Open

Export HS_VERSION in the public include files #222

vstakhov opened this issue Feb 27, 2020 · 3 comments

Comments

@vstakhov
Copy link

Hello, I'm asking if it is possible to include the Hyperscan version define somewhere in the public headers?

This information is essential if using of the new API function (in particular, I was thinking about hs_lit* functions). In theory, this could be checked on a configure stage by some CMake test in my case, but that would make it much more expensive as I would need to link C++ library during configure phase.

Having HS_VERSION macros will resolve this issue and this is the common technique used by many libraries.

@xiangwang1
Copy link
Contributor

Sure, we'll add that.

@Nor7th
Copy link

Nor7th commented Apr 16, 2020

@vstakhov
Hi, are you suggesting to put the entire version number in a public header, to avoid getting that number by doing cmake step (as version number is now defined in CMakeList.txt) which is not very practical for some scenarios like using Hyperscan via lib package rather than source code?

Please correct us if we misunderstood.

@vstakhov
Copy link
Author

Yes, I have seen it in Cmake files and it will work for embedded Hyperscan.
However, in the vast majority of the cases Hyperscan is provided as a library in the system (e.g. by package manager). The common sense is to have version number in the public include file or/and in the pkg-config export.
I would be happy with either option: the first will let me use direct #if VER > 0xYYYYYYUL ... #endif and the former will let me decide on build phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants