1
AC_DEFUN([CONFIG_EXTRA], [
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"
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
20
#if defined(__cplusplus)
23
# include <inttypes.h>
26
#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
28
typedef unsigned long int ulong;
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.
38
#ifdef TARGET_OS_WINDOWS
39
#define random() rand()
40
#define srandom(a) srand(a)
41
#define get_socket_errno() WSAGetLastError()
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
49
#ifndef HAVE_MSG_NOSIGNAL
50
#define MSG_NOSIGNAL 0
51
#endif // HAVE_MSG_NOSIGNAL
53
#ifndef HAVE_MSG_DONTWAIT
54
#define MSG_DONTWAIT 0
55
#endif // HAVE_MSG_DONTWAIT