misc.h: unexport compare_version()
Not used by any external modules, so no need to keep it in public header. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1807>
This commit is contained in:
parent
804b2c081b
commit
6c88eb0cc4
|
@ -37,6 +37,7 @@
|
|||
#include "dix/dix_priv.h"
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/fmt.h"
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/fmt.h"
|
||||
|
||||
#include "inputstr.h"
|
||||
#include "xkbstr.h"
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "dix/eventconvert.h"
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/fmt.h"
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
|
|
|
@ -31,14 +31,14 @@
|
|||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "inputstr.h"
|
||||
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "os/fmt.h"
|
||||
|
||||
#include "inputstr.h"
|
||||
#include "exglobals.h"
|
||||
#include "xiqueryversion.h"
|
||||
#include "misc.h"
|
||||
|
|
|
@ -125,6 +125,7 @@ Equipment Corporation.
|
|||
#include "dix/eventconvert.h"
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "os/bug_priv.h"
|
||||
#include "os/fmt.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "os/cmdline.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/ddx_priv.h"
|
||||
#include "os/fmt.h"
|
||||
#include "os/osdep.h"
|
||||
#include "os/xserver_poll.h"
|
||||
|
||||
|
|
|
@ -223,31 +223,8 @@ padding_for_int32(const int bytes)
|
|||
return ((-bytes) & 3);
|
||||
}
|
||||
|
||||
|
||||
extern _X_EXPORT char **xstrtokenize(const char *str, const char *separators);
|
||||
|
||||
/**
|
||||
* Compare the two version numbers comprising of major.minor.
|
||||
*
|
||||
* @return A value less than 0 if a is less than b, 0 if a is equal to b,
|
||||
* or a value greater than 0
|
||||
*/
|
||||
static inline int
|
||||
version_compare(uint32_t a_major, uint32_t a_minor,
|
||||
uint32_t b_major, uint32_t b_minor)
|
||||
{
|
||||
if (a_major > b_major)
|
||||
return 1;
|
||||
if (a_major < b_major)
|
||||
return -1;
|
||||
if (a_minor > b_minor)
|
||||
return 1;
|
||||
if (a_minor < b_minor)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* some macros to help swap requests, replies, and events */
|
||||
|
||||
#define LengthRestS(stuff) \
|
||||
|
|
22
os/fmt.h
22
os/fmt.h
|
@ -12,4 +12,26 @@ void FormatUInt64(uint64_t num, char *string);
|
|||
void FormatUInt64Hex(uint64_t num, char *string);
|
||||
void FormatDouble(double dbl, char *string);
|
||||
|
||||
/**
|
||||
* Compare the two version numbers comprising of major.minor.
|
||||
*
|
||||
* @return A value less than 0 if a is less than b, 0 if a is equal to b,
|
||||
* or a value greater than 0
|
||||
*/
|
||||
static inline int
|
||||
version_compare(uint32_t a_major, uint32_t a_minor,
|
||||
uint32_t b_major, uint32_t b_minor)
|
||||
{
|
||||
if (a_major > b_major)
|
||||
return 1;
|
||||
if (a_major < b_major)
|
||||
return -1;
|
||||
if (a_minor > b_minor)
|
||||
return 1;
|
||||
if (a_minor < b_minor)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _XSERVER_OS_FMT_H */
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "randr/randrstr_priv.h"
|
||||
#include "os/fmt.h"
|
||||
|
||||
#include "protocol-versions.h"
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/fmt.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "scrnintstr.h"
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "os/fmt.h"
|
||||
|
||||
#include "xfixesint.h"
|
||||
#include "protocol-versions.h"
|
||||
#include "extinit_priv.h"
|
||||
|
|
Loading…
Reference in New Issue