Debian Codegraph @

libmowgli-2/src/libmowgli/platform/win32/win32_stdinc.h

raw
1 /*
2 * libmowgli: A collection of useful routines for programming.
3 * win32_stdinc.h: Support functions and values for Win32 platform.
4 *
5 * Copyright (c) 2009 SystemInPlace, Inc.
6 *
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice is present in all copies.
10 *
11 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
12 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
13 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
15 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
16 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
18 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
19 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
20 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21 * POSSIBILITY OF SUCH DAMAGE.
22 */
23
24 #ifndef MOWGLI_SRC_LIBMOWGLI_PLATFORM_WIN32_WIN32_STDINC_H_INCLUDE_GUARD
25 #define MOWGLI_SRC_LIBMOWGLI_PLATFORM_WIN32_WIN32_STDINC_H_INCLUDE_GUARD 1
26
27 #ifdef _WIN32
28 # include <winsock2.h>
29 # include <ws2tcpip.h>
30 # include <time.h>
31 # define strcasecmp _stricmp
32 # define strdup _strdup
33 # ifdef _MSC_VER
34 # define snprintf _snprintf
35 # endif
36
37 extern int setenv(const char *name, const char *value, int overwrite);
38
39 extern int pipe(int pipefd[2]);
40 extern int socketpair(int domain, int type, int protocol, int pipefd[2]);
41 extern int fork(void);
42 extern int inet_pton(int af, const char *src, void *dst);
43 extern const char *inet_ntop(int af, const void *addr, char *host, size_t hostlen);
44
45 /* MSYS autoconf is fucko. */
46 # ifndef HAVE_WINSOCK2_H
47 # define HAVE_WINSOCK2_H
48 # endif
49 # define HAVE_SELECT
50
51 #endif
52
53 #endif /* MOWGLI_SRC_LIBMOWGLI_PLATFORM_WIN32_WIN32_STDINC_H_INCLUDE_GUARD */