Blob Blame History Raw
From b31fdb9db2fdab3df9f3225c3adcfee2bbb763e0 Mon Sep 17 00:00:00 2001
From: Eugene Syromyatnikov <evgsyr@gmail.com>
Date: Sun, 13 Oct 2019 17:06:08 +0200
Subject: [PATCH 58/76] xlat: provide fallback definitions for ABS_MT_*
 constants

* xlat/evdev_mtslots.in: Add fallback definitions.  Add #sorted.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201
---
 xlat/evdev_mtslots.in | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

Index: strace-5.1/xlat/evdev_mtslots.in
===================================================================
--- strace-5.1.orig/xlat/evdev_mtslots.in	2015-02-22 03:29:54.000000000 +0100
+++ strace-5.1/xlat/evdev_mtslots.in	2020-01-29 12:33:27.876943556 +0100
@@ -1,15 +1,15 @@
-ABS_MT_SLOT
-ABS_MT_TOUCH_MAJOR
-ABS_MT_TOUCH_MINOR
-ABS_MT_WIDTH_MAJOR
-ABS_MT_WIDTH_MINOR
-ABS_MT_ORIENTATION
-ABS_MT_POSITION_X
-ABS_MT_POSITION_Y
-ABS_MT_TOOL_TYPE
-ABS_MT_BLOB_ID
-ABS_MT_TRACKING_ID
-ABS_MT_PRESSURE
-ABS_MT_DISTANCE
-ABS_MT_TOOL_X
-ABS_MT_TOOL_Y
+ABS_MT_SLOT		0x2f
+ABS_MT_TOUCH_MAJOR	0x30
+ABS_MT_TOUCH_MINOR	0x31
+ABS_MT_WIDTH_MAJOR	0x32
+ABS_MT_WIDTH_MINOR	0x33
+ABS_MT_ORIENTATION	0x34
+ABS_MT_POSITION_X	0x35
+ABS_MT_POSITION_Y	0x36
+ABS_MT_TOOL_TYPE	0x37
+ABS_MT_BLOB_ID		0x38
+ABS_MT_TRACKING_ID	0x39
+ABS_MT_PRESSURE		0x3a
+ABS_MT_DISTANCE		0x3b
+ABS_MT_TOOL_X		0x3c
+ABS_MT_TOOL_Y		0x3d
Index: strace-5.1/xlat/evdev_mtslots.h
===================================================================
--- strace-5.1.orig/xlat/evdev_mtslots.h	2019-05-22 15:08:30.000000000 +0200
+++ strace-5.1/xlat/evdev_mtslots.h	2020-01-29 12:33:40.167830736 +0100
@@ -3,62 +3,137 @@
 #include "gcc_compat.h"
 #include "static_assert.h"
 
-
-#ifndef XLAT_MACROS_ONLY
-
-# ifdef IN_MPERS
-
-#  error static const struct xlat evdev_mtslots in mpers mode
-
-# else
-
-static
-const struct xlat evdev_mtslots[] = {
 #if defined(ABS_MT_SLOT) || (defined(HAVE_DECL_ABS_MT_SLOT) && HAVE_DECL_ABS_MT_SLOT)
-  XLAT(ABS_MT_SLOT),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_SLOT) == (0x2f), "ABS_MT_SLOT != 0x2f");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_SLOT 0x2f
 #endif
 #if defined(ABS_MT_TOUCH_MAJOR) || (defined(HAVE_DECL_ABS_MT_TOUCH_MAJOR) && HAVE_DECL_ABS_MT_TOUCH_MAJOR)
-  XLAT(ABS_MT_TOUCH_MAJOR),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_TOUCH_MAJOR) == (0x30), "ABS_MT_TOUCH_MAJOR != 0x30");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_TOUCH_MAJOR 0x30
 #endif
 #if defined(ABS_MT_TOUCH_MINOR) || (defined(HAVE_DECL_ABS_MT_TOUCH_MINOR) && HAVE_DECL_ABS_MT_TOUCH_MINOR)
-  XLAT(ABS_MT_TOUCH_MINOR),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_TOUCH_MINOR) == (0x31), "ABS_MT_TOUCH_MINOR != 0x31");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_TOUCH_MINOR 0x31
 #endif
 #if defined(ABS_MT_WIDTH_MAJOR) || (defined(HAVE_DECL_ABS_MT_WIDTH_MAJOR) && HAVE_DECL_ABS_MT_WIDTH_MAJOR)
-  XLAT(ABS_MT_WIDTH_MAJOR),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_WIDTH_MAJOR) == (0x32), "ABS_MT_WIDTH_MAJOR != 0x32");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_WIDTH_MAJOR 0x32
 #endif
 #if defined(ABS_MT_WIDTH_MINOR) || (defined(HAVE_DECL_ABS_MT_WIDTH_MINOR) && HAVE_DECL_ABS_MT_WIDTH_MINOR)
-  XLAT(ABS_MT_WIDTH_MINOR),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_WIDTH_MINOR) == (0x33), "ABS_MT_WIDTH_MINOR != 0x33");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_WIDTH_MINOR 0x33
 #endif
 #if defined(ABS_MT_ORIENTATION) || (defined(HAVE_DECL_ABS_MT_ORIENTATION) && HAVE_DECL_ABS_MT_ORIENTATION)
-  XLAT(ABS_MT_ORIENTATION),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_ORIENTATION) == (0x34), "ABS_MT_ORIENTATION != 0x34");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_ORIENTATION 0x34
 #endif
 #if defined(ABS_MT_POSITION_X) || (defined(HAVE_DECL_ABS_MT_POSITION_X) && HAVE_DECL_ABS_MT_POSITION_X)
-  XLAT(ABS_MT_POSITION_X),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_POSITION_X) == (0x35), "ABS_MT_POSITION_X != 0x35");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_POSITION_X 0x35
 #endif
 #if defined(ABS_MT_POSITION_Y) || (defined(HAVE_DECL_ABS_MT_POSITION_Y) && HAVE_DECL_ABS_MT_POSITION_Y)
-  XLAT(ABS_MT_POSITION_Y),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_POSITION_Y) == (0x36), "ABS_MT_POSITION_Y != 0x36");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_POSITION_Y 0x36
 #endif
 #if defined(ABS_MT_TOOL_TYPE) || (defined(HAVE_DECL_ABS_MT_TOOL_TYPE) && HAVE_DECL_ABS_MT_TOOL_TYPE)
-  XLAT(ABS_MT_TOOL_TYPE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_TOOL_TYPE) == (0x37), "ABS_MT_TOOL_TYPE != 0x37");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_TOOL_TYPE 0x37
 #endif
 #if defined(ABS_MT_BLOB_ID) || (defined(HAVE_DECL_ABS_MT_BLOB_ID) && HAVE_DECL_ABS_MT_BLOB_ID)
-  XLAT(ABS_MT_BLOB_ID),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_BLOB_ID) == (0x38), "ABS_MT_BLOB_ID != 0x38");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_BLOB_ID 0x38
 #endif
 #if defined(ABS_MT_TRACKING_ID) || (defined(HAVE_DECL_ABS_MT_TRACKING_ID) && HAVE_DECL_ABS_MT_TRACKING_ID)
-  XLAT(ABS_MT_TRACKING_ID),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_TRACKING_ID) == (0x39), "ABS_MT_TRACKING_ID != 0x39");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_TRACKING_ID 0x39
 #endif
 #if defined(ABS_MT_PRESSURE) || (defined(HAVE_DECL_ABS_MT_PRESSURE) && HAVE_DECL_ABS_MT_PRESSURE)
-  XLAT(ABS_MT_PRESSURE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_PRESSURE) == (0x3a), "ABS_MT_PRESSURE != 0x3a");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_PRESSURE 0x3a
 #endif
 #if defined(ABS_MT_DISTANCE) || (defined(HAVE_DECL_ABS_MT_DISTANCE) && HAVE_DECL_ABS_MT_DISTANCE)
-  XLAT(ABS_MT_DISTANCE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_DISTANCE) == (0x3b), "ABS_MT_DISTANCE != 0x3b");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_DISTANCE 0x3b
 #endif
 #if defined(ABS_MT_TOOL_X) || (defined(HAVE_DECL_ABS_MT_TOOL_X) && HAVE_DECL_ABS_MT_TOOL_X)
-  XLAT(ABS_MT_TOOL_X),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_TOOL_X) == (0x3c), "ABS_MT_TOOL_X != 0x3c");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_TOOL_X 0x3c
 #endif
 #if defined(ABS_MT_TOOL_Y) || (defined(HAVE_DECL_ABS_MT_TOOL_Y) && HAVE_DECL_ABS_MT_TOOL_Y)
-  XLAT(ABS_MT_TOOL_Y),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((ABS_MT_TOOL_Y) == (0x3d), "ABS_MT_TOOL_Y != 0x3d");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define ABS_MT_TOOL_Y 0x3d
 #endif
+
+#ifndef XLAT_MACROS_ONLY
+
+# ifdef IN_MPERS
+
+#  error static const struct xlat evdev_mtslots in mpers mode
+
+# else
+
+static
+const struct xlat evdev_mtslots[] = {
+ XLAT(ABS_MT_SLOT),
+ XLAT(ABS_MT_TOUCH_MAJOR),
+ XLAT(ABS_MT_TOUCH_MINOR),
+ XLAT(ABS_MT_WIDTH_MAJOR),
+ XLAT(ABS_MT_WIDTH_MINOR),
+ XLAT(ABS_MT_ORIENTATION),
+ XLAT(ABS_MT_POSITION_X),
+ XLAT(ABS_MT_POSITION_Y),
+ XLAT(ABS_MT_TOOL_TYPE),
+ XLAT(ABS_MT_BLOB_ID),
+ XLAT(ABS_MT_TRACKING_ID),
+ XLAT(ABS_MT_PRESSURE),
+ XLAT(ABS_MT_DISTANCE),
+ XLAT(ABS_MT_TOOL_X),
+ XLAT(ABS_MT_TOOL_Y),
  XLAT_END
 };