hyperscan icon indicating copy to clipboard operation
hyperscan copied to clipboard

Export HS_VERSION in the public include files

Open vstakhov opened this issue 5 years ago • 3 comments

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.

vstakhov avatar Feb 27 '20 15:02 vstakhov

Sure, we'll add that.

xiangwang1 avatar Mar 16 '20 01:03 xiangwang1

@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.

Nor7th avatar Apr 16 '20 06:04 Nor7th

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.

vstakhov avatar Apr 16 '20 10:04 vstakhov