bottom.m4 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. AC_DEFUN([CONFIG_EXTRA], [
  2. AH_TOP([
  3. #pragma once
  4. /* _SYS_FEATURE_TESTS_H is Solaris, _FEATURES_H is GCC */
  5. #if defined( _SYS_FEATURE_TESTS_H) || defined(_FEATURES_H)
  6. #error "You should include gear_config.h as your first include file"
  7. #endif
  8. ])
  9. AH_BOTTOM([
  10. /* This seems to be required for older compilers @note http://stackoverflow.com/questions/8132399/how-to-printf-uint64-t */
  11. #ifndef __STDC_FORMAT_MACROS
  12. # define __STDC_FORMAT_MACROS
  13. #endif
  14. #if defined(__cplusplus)
  15. # include CINTTYPES_H
  16. #else
  17. # include <inttypes.h>
  18. #endif
  19. #if !defined(HAVE_ULONG) && !defined(__USE_MISC)
  20. # define HAVE_ULONG 1
  21. typedef unsigned long int ulong;
  22. #endif
  23. /* To hide the platform differences between MS Windows and Unix, I am
  24. * going to use the Microsoft way and #define the Microsoft-specific
  25. * functions to the unix way. Microsoft use a separate subsystem for sockets,
  26. * but Unix normally just use a filedescriptor on the same functions. It is
  27. * a lot easier to map back to the unix way with macros than going the other
  28. * way without side effect.
  29. */
  30. #ifdef _WIN32
  31. #define random() rand()
  32. #define srandom(a) srand(a)
  33. #define get_socket_errno() WSAGetLastError()
  34. #else
  35. #define INVALID_SOCKET -1
  36. #define SOCKET_ERROR -1
  37. #define closesocket(a) close(a)
  38. #define get_socket_errno() errno
  39. #endif // _WIN32
  40. #ifndef HAVE_MSG_NOSIGNAL
  41. #define MSG_NOSIGNAL 0
  42. #endif // HAVE_MSG_NOSIGNAL
  43. #ifndef HAVE_MSG_DONTWAIT
  44. #define MSG_DONTWAIT 0
  45. #endif // HAVE_MSG_DONTWAIT
  46. #include "libboost/config/workaround.hpp"
  47. ])
  48. ])dnl CONFIG_EXTRA