mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-22 20:35:43 +00:00
devPrivates rework: hook up new mechanism in backwards-compatibility mode
on existing structures that support devPrivates.
This commit is contained in:
parent
aaef4d6a41
commit
c45f676208
4 changed files with 76 additions and 39 deletions
|
|
@ -30,6 +30,13 @@ typedef struct _Private {
|
|||
struct _Private *next;
|
||||
} 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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue