]> git.pond.sub.org Git - empserver/blob - src/lib/w32/w32misc.h
Update copyright notice
[empserver] / src / lib / w32 / w32misc.h
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                           Ken Stevens, Steve McClure
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  *  ---
21  *
22  *  See files README, COPYING and CREDITS in the root of the source
23  *  tree for related information and legal notices.  It is expected
24  *  that future projects/authors will amend these files as needed.
25  *
26  *  ---
27  *
28  *  w32misc.h: POSIX emulation for WIN32, miscellaneous stuff
29  *
30  *  Known contributors to this file:
31  *     Ron Koenderink, 2007
32  *     Markus Armbruster, 2007-2009
33  */
34
35 /*
36  * Stuff that cannot be put in the "correct" include files.  More of
37  * that in unistd.h.
38  */
39
40 #ifndef W32MISC_H
41 #define W32MISC_H
42
43 #include <stddef.h>
44
45 #ifdef _MSC_VER
46 /* integral mismatch, due to misuse of sector short */
47 #pragma warning (disable : 4761 )
48
49 /* strings.h */
50 #define strncasecmp(s1, s2, s3) _strnicmp((s1), (s2), (s3))
51 #endif /* _MSC_VER */
52
53 /* errno.h */
54 #define EWOULDBLOCK EAGAIN
55
56 /* fcntl.h */
57 #ifdef _MSC_VER
58 #define O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
59 #endif
60
61 /* stdio.h */
62 #ifdef _MSC_VER
63 #define snprintf _snprintf
64 #define vsnprintf _vsnprintf
65 #endif
66
67 /* stdlib.h */
68 #define initstate(seed, state, size) \
69     __initstate((seed), (state), (size))
70 #define setstate(state) __setstate((state))
71 #define srandom(seed) __srandom((seed))
72 #define random() __random()
73
74 extern char *__initstate(unsigned seed, char *state, size_t size);
75 extern long __random(void);
76 extern char *__setstate(char *state);
77 extern void __srandom(unsigned seed);
78
79 /* time.h */
80 struct tm;
81 extern char *strptime(const char *buf, const char *fmt, struct tm *tm);
82
83 #endif /* W32MISC_H */