diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-12 11:20:06 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-12 11:22:48 +1000 |
commit | a15af628154ac37f24896a30614f3be6ecdb65c4 (patch) | |
tree | 6561d1e1cc2d8b88c273643b3362f6607bab9ff4 | |
parent | ba981e223ae4449b08ff972b69220d435a735075 (diff) |
test: wrap ABI 14 xf86OptionRec type changes
ABI 13 still uses pointer as type for most option calls, ABI 14 uses the
proper type now. Wrap this so we can build against both versions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | test/fake-symbols.c | 42 | ||||
-rw-r--r-- | test/fake-symbols.h | 48 |
2 files changed, 48 insertions, 42 deletions
diff --git a/test/fake-symbols.c b/test/fake-symbols.c index 71c3bc5..a312aa0 100644 --- a/test/fake-symbols.c +++ b/test/fake-symbols.c @@ -26,7 +26,7 @@ xf86WaitForInput (int fd, int timeout) } _X_EXPORT int -xf86OpenSerial (pointer options) +xf86OpenSerial (OPTTYPE options) { return 0; } @@ -37,43 +37,43 @@ xf86SetSerialSpeed (int fd, int speed) return 0; } -_X_EXPORT pointer -xf86ReplaceIntOption(pointer optlist, const char *name, const int val) +_X_EXPORT OPTTYPE +xf86ReplaceIntOption(OPTTYPE optlist, const char *name, const int val) { return NULL; } _X_EXPORT char * -xf86SetStrOption(pointer optlist, const char *name, char *deflt) +xf86SetStrOption(OPTTYPE optlist, const char *name, char *deflt) { return NULL; } _X_EXPORT int -xf86SetBoolOption(pointer optlist, const char *name, int deflt) +xf86SetBoolOption(OPTTYPE optlist, const char *name, int deflt) { return 0; } -_X_EXPORT pointer -xf86AddNewOption(pointer head, const char *name, const char *val) +_X_EXPORT OPTTYPE +xf86AddNewOption(OPTTYPE head, const char *name, const char *val) { return NULL; } _X_EXPORT char * -xf86FindOptionValue(pointer options, const char *name) +xf86FindOptionValue(OPTTYPE options, const char *name) { return NULL; } _X_EXPORT char * -xf86OptionName(pointer opt) +xf86OptionName(OPTTYPE opt) { return NULL; } _X_EXPORT char * -xf86OptionValue(pointer opt) +xf86OptionValue(OPTTYPE opt) { return NULL; } @@ -85,7 +85,7 @@ xf86NameCmp(const char *s1, const char *s2) } _X_EXPORT char * -xf86CheckStrOption(pointer optlist, const char *name, char *deflt) +xf86CheckStrOption(OPTTYPE optlist, const char *name, char *deflt) { return NULL; } @@ -196,8 +196,8 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) return; } -_X_EXPORT pointer -xf86OptionListDuplicate(pointer options) +_X_EXPORT OPTTYPE +xf86OptionListDuplicate(OPTTYPE options) { return NULL; } @@ -225,7 +225,7 @@ xf86PostKeyboardEvent(DeviceIntPtr device, } _X_EXPORT int -xf86SetIntOption(pointer optlist, const char *name, int deflt) +xf86SetIntOption(OPTTYPE optlist, const char *name, int deflt) { return 0; } @@ -254,7 +254,7 @@ InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc) _X_EXPORT int XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent) + OPTTYPE value, Bool sendevent) { return 0; } @@ -367,15 +367,15 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, } -_X_EXPORT pointer -xf86ReplaceStrOption(pointer optlist, const char *name, const char* val) +_X_EXPORT OPTTYPE +xf86ReplaceStrOption(OPTTYPE optlist, const char *name, const char* val) { return NULL; } -_X_EXPORT pointer -xf86NextOption(pointer list) +_X_EXPORT OPTTYPE +xf86NextOption(OPTTYPE list) { return NULL; } @@ -424,14 +424,14 @@ InitFocusClassDeviceStruct(DeviceIntPtr dev) #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 void -xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer list) +xf86ProcessCommonOptions(InputInfoPtr pInfo, OPTTYPE list) { } void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts, - pointer extraOpts) + OPTTYPE extraOpts) { } diff --git a/test/fake-symbols.h b/test/fake-symbols.h index dfe1355..7c74f7a 100644 --- a/test/fake-symbols.h +++ b/test/fake-symbols.h @@ -1,29 +1,35 @@ #include <xorg-server.h> #include <xf86Xinput.h> +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14 +#define OPTTYPE XF86OptionPtr +#else +#define OPTTYPE pointer +#endif + extern int xf86ReadSerial (int fd, void *buf, int count); extern int xf86WriteSerial (int fd, const void *buf, int count); extern int xf86CloseSerial (int fd); extern int xf86WaitForInput (int fd, int timeout); -extern int xf86OpenSerial (pointer options); +extern int xf86OpenSerial (OPTTYPE options); extern int xf86SetSerialSpeed (int fd, int speed); -extern pointer xf86ReplaceIntOption(pointer optlist, const char *name, const int val); -extern pointer xf86AddNewOption(pointer head, const char *name, const char *val); -extern char* xf86OptionName(pointer opt); -extern char* xf86FindOptionValue(pointer options, const char *name); +extern OPTTYPE xf86ReplaceIntOption(OPTTYPE optlist, const char *name, const int val); +extern OPTTYPE xf86AddNewOption(OPTTYPE head, const char *name, const char *val); +extern char* xf86OptionName(OPTTYPE opt); +extern char* xf86FindOptionValue(OPTTYPE options, const char *name); extern int xf86NameCmp(const char *s1, const char *s2); -extern char* xf86CheckStrOption(pointer optlist, const char *name, char *deflt); +extern char* xf86CheckStrOption(OPTTYPE optlist, const char *name, char *deflt); -extern char * xf86SetStrOption(pointer optlist, const char *name, char *deflt); -extern int xf86SetBoolOption(pointer optlist, const char *name, int deflt); -extern pointer xf86AddNewOption(pointer head, const char *name, const char *val); -extern char* xf86FindOptionValue(pointer options, const char *name); -extern char* xf86OptionName(pointer opt); -extern char *xf86OptionValue(pointer opt); +extern char * xf86SetStrOption(OPTTYPE optlist, const char *name, char *deflt); +extern int xf86SetBoolOption(OPTTYPE optlist, const char *name, int deflt); +extern OPTTYPE xf86AddNewOption(OPTTYPE head, const char *name, const char *val); +extern char* xf86FindOptionValue(OPTTYPE options, const char *name); +extern char* xf86OptionName(OPTTYPE opt); +extern char *xf86OptionValue(OPTTYPE opt); extern int xf86NameCmp(const char *s1, const char *s2); -extern char * xf86CheckStrOption(pointer optlist, const char *name, char *deflt); +extern char * xf86CheckStrOption(OPTTYPE optlist, const char *name, char *deflt); extern void xf86AddEnabledDevice(InputInfoPtr pInfo); extern void xf86RemoveEnabledDevice(InputInfoPtr pInfo); extern Atom XIGetKnownProperty(char *name); @@ -53,7 +59,7 @@ XISetDevicePropertyDeletable(DeviceIntPtr dev, Atom property, Bool deletable); extern InputInfoPtr xf86FirstLocalDevice(void); extern void xf86DeleteInput(InputInfoPtr pInp, int flags); -extern pointer xf86OptionListDuplicate(pointer options); +extern OPTTYPE xf86OptionListDuplicate(OPTTYPE options); extern Bool InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom* labels, CARD8 *map); @@ -65,7 +71,7 @@ xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down); extern int -xf86SetIntOption(pointer optlist, const char *name, int deflt); +xf86SetIntOption(OPTTYPE optlist, const char *name, int deflt); extern void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, @@ -83,7 +89,7 @@ InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc); extern int XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent); + OPTTYPE value, Bool sendevent); extern CARD32 GetTimeInMillis (void); extern int @@ -132,10 +138,10 @@ extern Bool InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, int numMotionEvents, int mode); -extern pointer -xf86ReplaceStrOption(pointer optlist, const char *name, const char* val); +extern OPTTYPE +xf86ReplaceStrOption(OPTTYPE optlist, const char *name, const char* val); -extern pointer xf86NextOption(pointer list); +extern OPTTYPE xf86NextOption(OPTTYPE list); extern int XIGetDeviceProperty (DeviceIntPtr dev, Atom property, XIPropertyValuePtr *value); @@ -159,12 +165,12 @@ extern Bool InitFocusClassDeviceStruct(DeviceIntPtr dev); #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 extern void -xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer list); +xf86ProcessCommonOptions(InputInfoPtr pInfo, OPTTYPE list); extern void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts, - pointer extraOpts); + OPTTYPE extraOpts); extern InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags); |