Add a new type, l_uintptr_t, which is an unsigned integer type with the

same width as a pointer under Linux. Add two new macros, PTRIN and PTROUT,
which convert between l_uintptr_t and native pointers.
This commit is contained in:
Tim J. Robbins 2004-08-16 07:05:44 +00:00
parent 9f676d2ed6
commit 0e73a96209
2 changed files with 8 additions and 0 deletions

View File

@ -45,6 +45,9 @@ extern u_char linux_debug_map[];
MALLOC_DECLARE(M_LINUX);
#endif
#define PTRIN(v) (void *)(v)
#define PTROUT(v) (l_uintptr_t)(v)
typedef int l_int;
typedef int64_t l_long;
typedef int64_t l_longlong;
@ -55,6 +58,7 @@ typedef uint64_t l_ulonglong;
typedef unsigned short l_ushort;
typedef char *l_caddr_t;
typedef l_ulong l_uintptr_t;
typedef l_long l_clock_t;
typedef l_int l_daddr_t;
typedef l_uint l_dev_t;

View File

@ -47,6 +47,9 @@ extern u_char linux_debug_map[];
MALLOC_DECLARE(M_LINUX);
#endif
#define PTRIN(v) (void *)(v)
#define PTROUT(v) (l_uintptr_t)(v)
/*
* Provide a separate set of types for the Linux types.
*/
@ -60,6 +63,7 @@ typedef uint64_t l_ulonglong;
typedef unsigned short l_ushort;
typedef char *l_caddr_t;
typedef l_ulong l_uintptr_t;
typedef l_long l_clock_t;
typedef l_int l_daddr_t;
typedef l_ushort l_dev_t;