1 #ifndef __HAVE_CONFIG_H_ 2 #define __HAVE_CONFIG_H_ 3 4 #define _U_ 5 6 #define SIZEOF_INT_P 2 7 8 //#define DEBUGBUILD 9 #include "stdio.h" 10 #include "stdlib.h" 11 #include "string.h" 12 13 #if (!defined(nghttp_unlikely)) 14 #define nghttp_unlikely(Expression) !!(Expression) 15 #endif 16 17 #define nghttp_ASSERT(Expression) do{if (!(Expression)) printf("%d\n", __LINE__);}while(0) 18 19 #define CU_ASSERT(a) nghttp_ASSERT(a) 20 #define CU_ASSERT_FATAL(a) nghttp_ASSERT(a) 21 22 #if 1 23 #define NGHTTP2_DEBUG_INFO() printf("%s %d\n", __FILE__, __LINE__) 24 #else 25 #define NGHTTP2_DEBUG_INFO() 26 #endif 27 28 #define NGHTTP_PLATFORM_HTONS(_n) ((uint16_t)((((_n) & 0xff) << 8) | (((_n) >> 8) & 0xff))) 29 #define NGHTTP_PLATFORM_HTONL(_n) ((uint32_t)( (((_n) & 0xff) << 24) | (((_n) & 0xff00) << 8) | (((_n) >> 8) & 0xff00) | (((_n) >> 24) & 0xff) )) 30 31 #define htons(x) NGHTTP_PLATFORM_HTONS(x) 32 #define ntohs(x) NGHTTP_PLATFORM_HTONS(x) 33 #define htonl(x) NGHTTP_PLATFORM_HTONL(x) 34 #define ntohl(x) NGHTTP_PLATFORM_HTONL(x) 35 36 #endif 37