1 #ifndef OPENAFS_ROKEN_H
2 #define OPENAFS_ROKEN_H
8 /* Declarations for Microsoft Visual C runtime in Windows */
13 #ifndef __BITS_TYPES_DEFINED__
14 #define __BITS_TYPES_DEFINED__
16 typedef __int8 int8_t;
17 typedef __int16 int16_t;
18 typedef __int32 int32_t;
19 typedef __int64 int64_t;
20 typedef unsigned __int8 uint8_t;
21 typedef unsigned __int16 uint16_t;
22 typedef unsigned __int32 uint32_t;
23 typedef unsigned __int64 uint64_t;
24 typedef uint8_t u_int8_t;
25 typedef uint16_t u_int16_t;
26 typedef uint32_t u_int32_t;
27 typedef uint64_t u_int64_t;
29 #endif /* __BITS_TYPES_DEFINED__ */
33 typedef __int64 ssize_t;
40 #endif /* AFS_NT40_ENV */
42 #define rk_UNCONST(x) ((void *)(uintptr_t)(const void *)(x))
45 #define min(a,b) (((a)<(b))?(a):(b))
48 #ifndef ROKEN_LIB_FUNCTION
50 #define ROKEN_LIB_FUNCTION
51 #define ROKEN_LIB_CALL __cdecl
53 #define ROKEN_LIB_FUNCTION
54 #define ROKEN_LIB_CALL
58 typedef int rk_socket_t;
60 ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
61 ct_memcmp(const void *, const void *, size_t);
63 ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL rk_cloexec(int);
65 ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL rk_cloexec_file(FILE *);
67 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL
68 net_write (rk_socket_t, const void *, size_t);
70 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL
71 net_read (rk_socket_t, void *, size_t);
73 ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL issuid(void);
76 #define strlcpy rk_strlcpy
77 ROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL
78 strlcpy (char *, const char *, size_t);
82 # ifdef HAVE_DIR_DD_FD
83 # define dirfd(x) ((x)->dd_fd)
85 # ifndef _WIN32 /* Windows code never calls dirfd */
86 # error Missing dirfd() and ->dd_fd
91 /* This is a bodge, but it's only used by the tests */
92 #define emalloc(x) malloc(x)
94 #ifndef HAVE_GETPROGNAME
95 ROKEN_LIB_FUNCTION const char * ROKEN_LIB_CALL getprogname(void);
99 #define _PATH_DEVNULL "/dev/null"
102 #endif /* OPENAFS_ROKEN_H */