Ngx_version_hex

Igor, do you plan to add a macro with an usable nginx version number?

Thanks and regards Manlio P.

2007/11/23, Manlio P. [email protected]:

Igor, do you plan to add a macro with an usable nginx version number?

Seconded. I think it’s a good idea. Maybe stuff like (off the top of my
head):

#define NGX_VERSION_NUMBER(a,b,c) (((a) << 24) | ((b) << 16) | ((c) <<
8))
#define NGX_VERSION NGX_VERSION_NUMBER(0,5,33)

#if (NGX_VERSION < NGX_VERSION_NUMBER(0,6,0))
#error Development version only!
#endif

Best regards,
Grzegorz N.

On Fri, Nov 23, 2007 at 04:43:05PM +0100, Manlio P. wrote:

Igor, do you plan to add a macro with an usable nginx version number?

Yes, I will add it.

However, I do not want to stabilize API before 1.0.0.

Grzegorz N. ha scritto:

#endif

Here is some ugly code for an addon module configuration script:

NGX_RAW_VERSION=awk '/#define NGINX_VERSION/ {print $3}' \ src/core/nginx.h

NGX_VERSION_HEX=${PYTHON} -c 'import sys; raw_version = sys.argv[1]; \ v = map(int, raw_version[1:-1].split(".")); \ print v[0] << 24 | v[1] << 16 | v[2] << 8' ${NGX_RAW_VERSION}

have=NGX_VERSION_HEX value="$NGX_VERSION_HEX" . auto/define

It requires awk and Python.

Best regards,
Grzegorz N.

Manlio P.

Igor S. ha scritto:

On Fri, Nov 23, 2007 at 04:43:05PM +0100, Manlio P. wrote:

Igor, do you plan to add a macro with an usable nginx version number?

Yes, I will add it.

Great, thanks.

However, I do not want to stabilize API before 1.0.0.

Not a problem for me.

I can also provide support for different nginx version using patches, if
there are big changes.

Manlio P.