]> arthur.barton.de Git - netatalk.git/blob - libatalk/adouble/ad_private.h
Initial revision
[netatalk.git] / libatalk / adouble / ad_private.h
1 #ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
2 #define LIBATALK_ADOUBLE_AD_PRIVATE_H 1
3
4 #include <atalk/adouble.h>
5
6 #ifndef MAP_FAILED
7 #define MAP_FAILED ((void *) -1)
8 #endif
9
10 #ifndef __inline__
11 #define __inline__
12 #endif
13
14 /* this is so that we can keep lists of fds referencing the same file
15  * around. that way, we can honor locks created by the same process
16  * with the same file. */
17 #ifdef USE_FLOCK_LOCKS
18 #define adf_lock_init(a)
19 #define adf_lock_free(a)
20 #else
21
22 #define adf_lock_init(a) do { \
23         (a)->adf_lockmax = (a)->adf_lockcount = 0; \
24         (a)->adf_lock = NULL; \
25 } while (0)
26
27 #define adf_lock_free(a) do { \
28         if (!(a)->adf_lock) \
29                 break; \
30         free((a)->adf_lock); \
31         adf_lock_init(a); \
32 } while (0)
33 #endif
34
35 #endif /* libatalk/adouble/ad_private.h */