8144146: Unified Logging tags cannot be reserved keywords
authormlarsson
Fri, 04 Dec 2015 13:02:25 +0100
changeset 34656 501b8f1784c4
parent 34655 d48cb26b07c2
child 34658 7ffe56626bc2
child 34659 3a7071043457
child 34662 3080f4a935d8
8144146: Unified Logging tags cannot be reserved keywords Reviewed-by: dholmes, sla
hotspot/src/share/vm/logging/logTag.hpp
--- a/hotspot/src/share/vm/logging/logTag.hpp	Fri Dec 04 09:36:16 2015 -0800
+++ b/hotspot/src/share/vm/logging/logTag.hpp	Fri Dec 04 13:02:25 2015 +0100
@@ -38,7 +38,7 @@
   LOG_TAG(safepoint) \
   LOG_TAG(vmoperation)
 
-#define PREFIX_LOG_TAG(T) (LogTag::T)
+#define PREFIX_LOG_TAG(T) (LogTag::_##T)
 
 // Expand a set of log tags to their prefixed names.
 // For error detection purposes, the macro passes one more tag than what is supported.
@@ -47,7 +47,7 @@
                                                         PREFIX_LOG_TAG(T3), PREFIX_LOG_TAG(T4), PREFIX_LOG_TAG(T5)
 // The EXPAND_VARARGS macro is required for MSVC, or it will resolve the LOG_TAGS_EXPANDED macro incorrectly.
 #define EXPAND_VARARGS(x) x
-#define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(__VA_ARGS__, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG, __NO_TAG))
+#define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(__VA_ARGS__, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG))
 
 // Log tags are used to classify log messages.
 // Each log message can be assigned between 1 to LogTag::MaxTags number of tags.
@@ -63,7 +63,7 @@
 
   enum type {
     __NO_TAG,
-#define LOG_TAG(name) name,
+#define LOG_TAG(name) _##name,
     LOG_TAG_LIST
 #undef LOG_TAG
     Count