diff --git a/common/parse.h b/common/parse.h index f92e76de..3ec37104 100644 --- a/common/parse.h +++ b/common/parse.h @@ -278,6 +278,35 @@ struct stream } while (0) #endif +/******************************************************************************/ +#if defined(B_ENDIAN) || defined(NEED_ALIGN) +#define out_uint64_le(s, v) do \ +{ \ + *((s)->p) = (unsigned char)((v) >> 0); \ + (s)->p++; \ + *((s)->p) = (unsigned char)((v) >> 8); \ + (s)->p++; \ + *((s)->p) = (unsigned char)((v) >> 16); \ + (s)->p++; \ + *((s)->p) = (unsigned char)((v) >> 24); \ + (s)->p++; \ + *((s)->p) = (unsigned char)((v) >> 32); \ + (s)->p++; \ + *((s)->p) = (unsigned char)((v) >> 40); \ + (s)->p++; \ + *((s)->p) = (unsigned char)((v) >> 48); \ + (s)->p++; \ + *((s)->p) = (unsigned char)((v) >> 56); \ + (s)->p++; \ +} while (0) +#else +#define out_uint64_le(s, v) do \ +{ \ + *((tui64*)((s)->p)) = (v); \ + (s)->p += 8; \ +} while (0) +#endif + /******************************************************************************/ #define out_uint32_be(s, v) do \ { \