Rudiments
fileincludes.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#include <rudiments/private/dll.h>
5#include <rudiments/filedescriptor.h>
6#include <rudiments/linkedlist.h>
7
8#include <sys/types.h>
9
10// some systems need this for key_t
11#ifdef RUDIMENTS_HAVE_SYS_IPC_H
12 #ifndef RUDIMENTS_SYS_IPC_H
13 #define RUDIMENTS_SYS_IPC_H
14 #include <sys/ipc.h>
15 #endif
16#endif
17
18// for open flags
19#ifdef RUDIMENTS_HAVE_FCNTL_H
20 // for open flags with msvc/mingw32...
21 // make sure to undefine _POSIX_ if it wasn't already defined though,
22 // as it will prevent various process-related functions from being
23 // found later if it's still defined
24 #ifdef _WIN32
25 #ifndef _POSIX_
26 #define _POSIX_
27 #define RUDIMENTS_UNDEFPOSIX
28 #endif
29 #endif
30 #include <fcntl.h>
31 #ifdef _WIN32
32 #ifdef RUDIMENTS_UNDEFPOSIX
33 #undef _POSIX_
34 #endif
35 #endif
36#endif
37
38#ifndef RUDIMENTS_HAVE_BLKSIZE_T
39 typedef long blksize_t;
40#endif
41#ifndef RUDIMENTS_HAVE_BLKCNT_T
42 typedef long blkcnt_t;
43#endif
44
45// windows doesn't define these but we need them to be able to lock files
46#ifndef F_RDLCK
47 #define F_RDLCK 0
48#endif
49#ifndef F_WRLCK
50 #define F_WRLCK 1
51#endif
52#ifndef F_UNLCK
53 #define F_UNLCK 2
54#endif
55
56// most platforms don't define O_BINARY but it's
57// helpful to have it for portability
58#ifndef O_BINARY
59 #define O_BINARY 0
60#endif
61
62class fileprivate;
Definition avltree.h:11