diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-07-28 15:36:22 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-07-28 15:36:22 +0200 |
commit | 6beba9ee559fe372fcd997835441bcf94e8d3502 (patch) | |
tree | beafa3ede81b00793248e5dd1d083113dda9785c /common.h | |
parent | 5ead039965dc3d58466f982ab3eb8680e69a269c (diff) |
added some preventive byteswapping for bigendian support in the future
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |