File: HsNetDef.h

package info (click to toggle)
haskell-network 3.2.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 760 kB
  • sloc: sh: 3,379; haskell: 2,211; ansic: 536; makefile: 3
file content (50 lines) | stat: -rw-r--r-- 1,093 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef HSNETDEF_H
#define HSNETDEF_H

#include "HsNetworkConfig.h"

/* ultra-evil... */
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION

#if defined(HAVE_STRUCT_UCRED) && HAVE_DECL_SO_PEERCRED
# define HAVE_STRUCT_UCRED_SO_PEERCRED 1
#else
# undef HAVE_STRUCT_UCRED_SO_PEERCRED
#endif

#ifdef HAVE_ACCEPT4
# define HAVE_ADVANCED_SOCKET_FLAGS 1
#else
# undef HAVE_ADVANCED_SOCKET_FLAGS
#endif

/* stdcall is for Windows 32.
   Haskell FFI does not have a keyword for Windows 64.
   If ccall/stdcall is specified on Windows 64,
   GHC ignores it and use a proper ABI for Windows 64.
   But if stdcall is specified, GHC displays a warning.
   So, let's use ccall for Windows 64.
 */
#if defined(mingw32_HOST_OS)
# if defined(i386_HOST_ARCH)
#  define CALLCONV stdcall
# elif defined(x86_64_HOST_ARCH)
#  define CALLCONV ccall
# else
#  error Unknown mingw32 arch
# endif
#else
# define CALLCONV ccall
#endif

#if defined(mingw32_HOST_OS)
# define SAFE_ON_WIN safe
#else
# define SAFE_ON_WIN unsafe
#endif

#endif /* HSNETDEF_H */