Updates to m4
[m6w6/libmemcached] / m4 / bottom.m4
1 AC_DEFUN([CONFIG_EXTRA], [
2
3 AH_TOP([
4 #pragma once
5
6 /* _SYS_FEATURE_TESTS_H is Solaris, _FEATURES_H is GCC */
7 #if defined( _SYS_FEATURE_TESTS_H) || defined(_FEATURES_H)
8 #error "You should include config.h as your first include file"
9 #endif
10
11 ])
12
13 AH_BOTTOM([
14
15 #if defined(__cplusplus)
16 #include CSTDINT_H
17 #include CINTTYPES_H
18 #else
19 #include <stdint.h>
20 #include <inttypes.h>
21 #endif
22
23 #if !defined(HAVE_ULONG) && !defined(__USE_MISC)
24 # define HAVE_ULONG 1
25 typedef unsigned long int ulong;
26 #endif
27
28 ])
29
30 AH_BOTTOM([
31 #ifdef WIN32
32 #define _WIN32_WINNT 0x0501
33 #endif
34
35 /* To hide the platform differences between MS Windows and Unix, I am
36 * going to use the Microsoft way and #define the Microsoft-specific
37 * functions to the unix way. Microsoft use a separate subsystem for sockets,
38 * but Unix normally just use a filedescriptor on the same functions. It is
39 * a lot easier to map back to the unix way with macros than going the other
40 * way without side effect ;-)
41 */
42 #ifdef WIN32
43 #include "win32/wrappers.h"
44 #define get_socket_errno() WSAGetLastError()
45 #else
46 #define INVALID_SOCKET -1
47 #define SOCKET_ERROR -1
48 #define closesocket(a) close(a)
49 #define get_socket_errno() errno
50 #endif
51
52 #ifndef HAVE_MSG_NOSIGNAL
53 #define MSG_NOSIGNAL 0
54 #endif
55
56 #ifndef HAVE_MSG_DONTWAIT
57 #define MSG_DONTWAIT 0
58 #endif
59
60 #ifndef HAVE_MSG_MORE
61 #define MSG_MORE 0
62 #endif
63
64 ])
65 ])dnl CONFIG_EXTRA