diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-03-07 11:22:42 -0500 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-uranus.epoch.ncsc.mil> | 2007-03-08 12:12:51 -0500 |
commit | c45f6762080ef00b41d9f73441a9f0e605253008 (patch) | |
tree | f14a89f6c47308efae6ad4d352816dd34deb8974 /include/privates.h | |
parent | aaef4d6a4121d9341b670a0ce8fabc3b491049cf (diff) |
devPrivates rework: hook up new mechanism in backwards-compatibility mode
on existing structures that support devPrivates.
Diffstat (limited to 'include/privates.h')
-rw-r--r-- | include/privates.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/privates.h b/include/privates.h index 898fdd9c9..9c95350fa 100644 --- a/include/privates.h +++ b/include/privates.h @@ -31,6 +31,13 @@ typedef struct _Private { } PrivateRec; /* + * Backwards compatibility macro. Use to get the proper PrivateRec + * reference from any of the structure types that supported the old + * devPrivates mechanism. + */ +#define DEVPRIV_PTR(foo) ((PrivateRec **)(&(foo)->devPrivates[0].ptr)) + +/* * Request pre-allocated private space for your driver/module. * A non-null pScreen argument restricts to objects on a given screen. */ @@ -156,4 +163,7 @@ dixLookupPrivateOffset(RESTYPE type); extern int dixRegisterPrivateOffset(RESTYPE type, unsigned offset); +/* Used by the legacy support, don't rely on this being here */ +#define PadToLong(w) ((((w) + sizeof(long)-1) / sizeof(long)) * sizeof(long)) + #endif /* PRIVATES_H */ |