]> granicus.if.org Git - strace/commitdiff
Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 29 Apr 2016 00:03:48 +0000 (00:03 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 29 Apr 2016 00:15:01 +0000 (00:15 +0000)
* xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts
to the specified type instead of unsigned int.
(XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts
to the specified type instead of unsigned int.

xlat.h

diff --git a/xlat.h b/xlat.h
index 2abf909d051ae077bf0144bc57454a86594f833a..9e68a17a83df2663b5c30e2251b756afc10f737b 100644 (file)
--- a/xlat.h
+++ b/xlat.h
@@ -7,6 +7,8 @@ struct xlat {
 
 # define XLAT(val)                     { (unsigned)(val), #val }
 # define XLAT_PAIR(val, str)           { (unsigned)(val), str  }
+# define XLAT_TYPE(type, val)          {     (type)(val), #val }
+# define XLAT_TYPE_PAIR(val, str)      {     (type)(val), str  }
 # define XLAT_END                      {               0, 0    }
 
 #endif