~linuxjedi/libdrizzle/5.1-binlog-callback

« back to all changes in this revision

Viewing changes to m4/bottom.m4

  • Committer: Andrew Hutchings
  • Date: 2012-12-17 12:03:43 UTC
  • mfrom: (44.1.1 libdrizzle)
  • Revision ID: andrew@linuxjedi.co.uk-20121217120343-tgde4ngz85yc6rsq
Merge in Brian's autoconf work

Show diffs side-by-side

added added

removed removed

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