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

config: introduce integer LWS_LIBRARY_VERSION_NUMBER, micro numbering #159

Closed
wants to merge 1 commit into from

Conversation

mhaberler
Copy link

the current LWS_LIBRARY_VERSION macro is a string, which makes it hard
to test for version-dependent features in using code.

This patch adopts the Google version number method, which encodes a version
as an integer as 'major * 10^6 + minor * 10^3 + micro'.

This makes it easy to test:

if defined(LWS_LIBRARY_VERSION_NUMBER) && (LWS_LIBRARY_VERSION_NUMBER > 1003000)

// use feature introduced post 1.3.0

endif

Also, spin out version information into a separate include since
including library build information from lws_config.h is a bad idea as
it interferes with using code.

Signed-off-by: Michael Haberler git@mah.priv.at

the current LWS_LIBRARY_VERSION macro is a string, which makes it hard
to test for version-dependent features in using code.

This patch adopts the Google version number method, which encodes a version
as an integer as 'major * 10^6 + minor * 10^3 + micro'.

This makes it easy to test:

#if defined(LWS_LIBRARY_VERSION_NUMBER) && (LWS_LIBRARY_VERSION_NUMBER > 1003000)
	// use feature introduced post 1.3.0
#endif

Also, spin out version information into a separate include since
including library build information from lws_config.h is a bad idea as
it interferes with using code.

Signed-off-by: Michael Haberler <git@mah.priv.at>
@mhaberler mhaberler closed this Aug 11, 2014
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

Successfully merging this pull request may close these issues.

None yet

1 participant