Rename ESC -> ESC_PARENS
authorPedro Alves <palves@redhat.com>
Wed, 23 Jan 2019 18:58:28 +0000 (18:58 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 23 Jan 2019 18:58:28 +0000 (18:58 +0000)
A following patch will include common/preprocessor.h in some .c file
that also includes readline.h, and that revealed a conflict -- ESC is
defined by readline.h as well (actually readline's chardefs.h) with a
completely unrelated meaning:

 #define ESC CTRL('[')

Rename our version to avoid the conflict.

gdb/ChangeLog:
2019-01-23  Pedro Alves  <palves@redhat.com>

* common/preprocessor.h (ESC): Rename to ...
(ESC_PARENS): ... this.
* common/valid-expr.h (CHECK_VALID_EXPR_1, CHECK_VALID_EXPR_2)
(CHECK_VALID_EXPR_3, CHECK_VALID_EXPR_4): Adjust.

gdb/ChangeLog
gdb/common/preprocessor.h
gdb/common/valid-expr.h

index f302fc4a82ebb27bc362dcc26c8d21a4e6505caa..60c19239c645467fe7711fb8a4901bd4ff0db09c 100644 (file)
@@ -1,3 +1,10 @@
+2019-01-23  Pedro Alves  <palves@redhat.com>
+
+       * common/preprocessor.h (ESC): Rename to ...
+       (ESC_PARENS): ... this.
+       * common/valid-expr.h (CHECK_VALID_EXPR_1, CHECK_VALID_EXPR_2)
+       (CHECK_VALID_EXPR_3, CHECK_VALID_EXPR_4): Adjust.
+
 2019-01-23  Tom Tromey  <tom@tromey.com>
 
        * language.h (class scoped_switch_to_sym_language_if_auto):
index 647568ede60acf3a958c5b2c759a65836710b3cc..a7c33d0978e2473da2073550a83804a143389ff9 100644 (file)
@@ -30,6 +30,6 @@
 
 /* Escape parens out.  Useful if you need to pass an argument that
    includes commas to another macro.  */
-#define ESC(...) __VA_ARGS__
+#define ESC_PARENS(...) __VA_ARGS__
 
 #endif /* COMMON_PREPROC */
index 9289448365848975f3a7adaf912948f3e50cc52d..603c76e8f130bb72883bc011c39d4bd6e1af20f5 100644 (file)
    another variant.  */
 
 #define CHECK_VALID_EXPR_1(T1, VALID, EXPR_TYPE, EXPR)                 \
-  CHECK_VALID_EXPR_INT (ESC (typename T1),                             \
-                       ESC (T1),                                       \
+  CHECK_VALID_EXPR_INT (ESC_PARENS (typename T1),                      \
+                       ESC_PARENS (T1),                                \
                        VALID, EXPR_TYPE, EXPR)
 
 #define CHECK_VALID_EXPR_2(T1, T2, VALID, EXPR_TYPE, EXPR)             \
-  CHECK_VALID_EXPR_INT (ESC (typename T1, typename T2),                        \
-                       ESC (T1, T2),                                   \
+  CHECK_VALID_EXPR_INT (ESC_PARENS(typename T1, typename T2),          \
+                       ESC_PARENS (T1, T2),                            \
                        VALID, EXPR_TYPE, EXPR)
 
 #define CHECK_VALID_EXPR_3(T1, T2, T3, VALID, EXPR_TYPE, EXPR)         \
-  CHECK_VALID_EXPR_INT (ESC (typename T1, typename T2, typename T3),   \
-                       ESC (T1, T2, T3),                               \
+  CHECK_VALID_EXPR_INT (ESC_PARENS (typename T1, typename T2, typename T3), \
+                       ESC_PARENS (T1, T2, T3),                                \
                        VALID, EXPR_TYPE, EXPR)
 
 #define CHECK_VALID_EXPR_4(T1, T2, T3, T4, VALID, EXPR_TYPE, EXPR)     \
-  CHECK_VALID_EXPR_INT (ESC (typename T1, typename T2,                 \
-                            typename T3, typename T4),                 \
-                       ESC (T1, T2, T3, T4),                           \
+  CHECK_VALID_EXPR_INT (ESC_PARENS (typename T1, typename T2,          \
+                                   typename T3, typename T4),          \
+                       ESC_PARENS (T1, T2, T3, T4),                    \
                        VALID, EXPR_TYPE, EXPR)
 
 #endif /* COMMON_VALID_EXPR_H */