diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index c11643805b9ec113ebb72eda34505ad0f2c61f7c..93b62f2735c74272a20b47a9ea206a00feb7ab98 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -110,19 +110,19 @@ static char version_id[16] = "P002F202";
 #define htolel(x) (x)
 #define htoles(x) (x)
 #else
-#ifdef HAVE_BYTESWAP_H
+#if defined(HAVE_BYTESWAP_H)
 #include <byteswap.h>
 #define letohl(x) bswap_32(x)
 #define letohs(x) bswap_16(x)
 #define htolel(x) bswap_32(x)
 #define htoles(x) bswap_16(x)
-#elif HAVE_SYS_ENDIAN_SWAP16
+#elif defined(HAVE_SYS_ENDIAN_SWAP16)
 #include <sys/endian.h>
 #define letohl(x) __swap32(x)
 #define letohs(x) __swap16(x)
 #define htolel(x) __swap32(x)
 #define htoles(x) __swap16(x)
-#elif HAVE_SYS_ENDIAN_BSWAP16
+#elif defined(HAVE_SYS_ENDIAN_BSWAP16)
 #include <sys/endian.h>
 #define letohl(x) bswap32(x)
 #define letohs(x) bswap16(x)