Commit acb782d1 authored by rswindell's avatar rswindell
Browse files

Updated for C++ compatibility.

parent 5bae6c09
......@@ -38,13 +38,18 @@
#ifndef _CRC16_H_
#define _CRC16_H_
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned short crc16tbl[];
#define ucrc16(ch,crc) (crc16tbl[((crc>>8)&0xff)^(unsigned char)ch]^(crc << 8))
unsigned short crc16(char *data, unsigned long len);
#ifdef __cplusplus
extern "C"
}
#endif
unsigned short crc16(char *data, unsigned long len);
#endif
#define ucrc16(ch,crc) (crc16tbl[((crc>>8)&0xff)^(unsigned char)ch]^(crc << 8))
#endif /* Don't add anything after this line */
......@@ -38,13 +38,18 @@
#ifndef _CRC32_H_
#define _CRC32_H_
#ifdef __cplusplus
extern "C" {
#endif
extern long crc32tbl[];
#define ucrc32(ch,crc) (crc32tbl[(crc^ch)&0xff]^(crc>>8))
unsigned long crc32(char* buf, unsigned long len);
#ifdef __cplusplus
extern "C"
}
#endif
unsigned long crc32(char *buf, unsigned long len);
#endif
#define ucrc32(ch,crc) (crc32tbl[(crc^(ch))&0xff]^(crc>>8))
#endif /* Don't add anything after this line */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment