config.h 969 B

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