Bug 1414506 - Drive-by: Remove MOZ_CONCAT definition from mozglue/linker/Logging.h. r?froydnj draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 19 Jan 2018 20:12:04 +0900
changeset 747313 e0b088f3b2cb2d807718522708d69dbe2262532b
parent 747312 7b5a92c5d3669d1890378b08724f4633ad9eed56
child 747314 6d8a03a18ab8f70106530b18ecbc8280a3435140
push id96871
push userbmo:mh+mozilla@glandium.org
push dateThu, 25 Jan 2018 21:23:22 +0000
reviewersfroydnj
bugs1414506
milestone60.0a1
Bug 1414506 - Drive-by: Remove MOZ_CONCAT definition from mozglue/linker/Logging.h. r?froydnj The same exists in mozilla/MacroArgs.h, avoiding a macro redefined warning when building on non-Android.
mozglue/linker/Logging.h
--- a/mozglue/linker/Logging.h
+++ b/mozglue/linker/Logging.h
@@ -1,16 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef Logging_h
 #define Logging_h
 
 #include "mozilla/Likely.h"
+#include "mozilla/MacroArgs.h"
 
 #ifdef ANDROID
 #include <android/log.h>
 #define LOG(...) __android_log_print(ANDROID_LOG_INFO, "GeckoLinker", __VA_ARGS__)
 #define WARN(...) __android_log_print(ANDROID_LOG_WARN, "GeckoLinker", __VA_ARGS__)
 #define ERROR(...) __android_log_print(ANDROID_LOG_ERROR, "GeckoLinker", __VA_ARGS__)
 #else
 #include <cstdio>
@@ -19,19 +20,16 @@
  * given. */
 #define MOZ_ONE_OR_MORE_ARGS_IMPL2(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) \
   N
 #define MOZ_ONE_OR_MORE_ARGS_IMPL(args) MOZ_ONE_OR_MORE_ARGS_IMPL2 args
 #define MOZ_ONE_OR_MORE_ARGS(...) \
   MOZ_ONE_OR_MORE_ARGS_IMPL((__VA_ARGS__, m, m, m, m, m, m, m, m, 1, 0))
 
 #define MOZ_MACRO_GLUE(a, b) a b
-#define MOZ_CONCAT2(a, b) a ## b
-#define MOZ_CONCAT1(a, b) MOZ_CONCAT2(a, b)
-#define MOZ_CONCAT(a, b) MOZ_CONCAT1(a, b)
 
 /* Some magic to choose between LOG1 and LOGm depending on the number of
  * arguments */
 #define MOZ_CHOOSE_LOG(...) \
   MOZ_MACRO_GLUE(MOZ_CONCAT(LOG, MOZ_ONE_OR_MORE_ARGS(__VA_ARGS__)), \
                  (__VA_ARGS__))
 
 #define LOG1(format) fprintf(stderr, format "\n")