Mercurial > hg > nginx
view src/core/ngx_crc.h @ 4849:026ff0eb3062 stable-1.2
Merge of r4779, r4840, r4843, r4844: win32 changes.
*) Fixed build with Visual Studio 2005 Express.
It is available via winetricks which makes it still usable, and has
an old crtdefs.h which uses _CRT_SECURE_NO_DEPRECATE instead of
_CRT_SECURE_NO_WARNINGS to suppress warnings.
Reported by HAYASHI Kentaro,
http://mailman.nginx.org/pipermail/nginx-devel/2012-August/002542.html
*) Configure: provide inflate() when building zlib on win32.
*) Helper target "win32" to run configure for win32 builds.
*) Updated zlib used for win32 builds.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 24 Sep 2012 18:37:14 +0000 |
parents | d620f497c50f |
children |
line wrap: on
line source
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #ifndef _NGX_CRC_H_INCLUDED_ #define _NGX_CRC_H_INCLUDED_ #include <ngx_config.h> #include <ngx_core.h> /* 32-bit crc16 */ static ngx_inline uint32_t ngx_crc(u_char *data, size_t len) { uint32_t sum; for (sum = 0; len; len--) { /* * gcc 2.95.2 x86 and icc 7.1.006 compile * that operator into the single "rol" opcode, * msvc 6.0sp2 compiles it into four opcodes. */ sum = sum >> 1 | sum << 31; sum += *data++; } return sum; } #endif /* _NGX_CRC_H_INCLUDED_ */