#define WRITE_U32(buf, x) (buf)[0] = (unsigned char)((x) & 0xff);\
(buf)[1] = (unsigned char)(((x) >> 8) & 0xff);\
(buf)[2] = (unsigned char)(((x) >> 16) & 0xff);\
(buf)[3] = (unsigned char)(((x) >> 24) & 0xff);
#define WRITE_U32(buf, x) (buf)[0] = (unsigned char)((x) & 0xff);\
(buf)[1] = (unsigned char)(((x) >> 8) & 0xff);\
(buf)[2] = (unsigned char)(((x) >> 16) & 0xff);\
(buf)[3] = (unsigned char)(((x) >> 24) & 0xff);