From 6beba9ee559fe372fcd997835441bcf94e8d3502 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 28 Jul 2009 15:36:22 +0200 Subject: added some preventive byteswapping for bigendian support in the future --- common.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'common.h') diff --git a/common.h b/common.h index 63f0f010..0cefcb8d 100644 --- a/common.h +++ b/common.h @@ -4,4 +4,16 @@ #define min(x,y) ((x)<(y)?(x):(y)) #define max(x,y) ((x)>(y)?(x):(y)) +inline void +le_int16 (int16_t in, char *out) { + char *pin = (char *)∈ +#if !BIGENDIAN + out[0] = pin[0]; + out[1] = pin[1]; +#else + out[1] = pin[0]; + out[0] = pin[1]; +#endif +} + #endif // __COMMON_H -- cgit v1.2.3