#ifndef BYTEORDER_H_
#define BYTEORDER_H_
-#include <stdint.h>
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#include <stdint.h>
+
static inline uint16_t _flip16(uint16_t val)
{
uint16_t hostval;
# define letohs(x) _flip16(x)
# define letohl(x) _flip32(x)
#else
-# define letohs(x) (x)
-# define letohl(x) (x)
+# define letohs(x) ((uint16_t)(x))
+# define letohl(x) ((uint16_t)(x))
#endif
#endif