byteorder.h 757 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. Taken from libmemcached.
  3. */
  4. /* LibMemcached
  5. * Copyright (C) 2006-2009 Brian Aker
  6. * All rights reserved.
  7. *
  8. * Use and distribution licensed under the BSD license. See
  9. * the COPYING file in the parent directory for full text.
  10. *
  11. * Summary:
  12. *
  13. */
  14. #pragma once
  15. #ifndef HAVE_HTONLL
  16. GEARMAN_INTERNAL_API
  17. uint64_t ntohll(uint64_t);
  18. GEARMAN_INTERNAL_API
  19. uint64_t htonll(uint64_t);
  20. #endif
  21. #ifdef linux
  22. /* /usr/include/netinet/in.h defines macros from ntohs() to _bswap_nn to
  23. * optimize the conversion functions, but the prototypes generate warnings
  24. * from gcc. The conversion methods isn't the bottleneck for my app, so
  25. * just remove the warnings by undef'ing the optimization ..
  26. */
  27. #undef ntohs
  28. #undef ntohl
  29. #undef htons
  30. #undef htonl
  31. #endif