mfbt/Unused.h
author L10n Bumper Bot <release+l10nbumper@mozilla.com>
Sat, 17 Aug 2019 22:00:30 +0000
changeset 541974 9823cd4c602efc28acf35b792809aa984696fd9f
parent 505383 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD be -> 4bc02cde99e6 cak -> 44111b3919f3 cs -> 106a54b4c9ae cy -> b2d70c7f4dc2 el -> a26c1aca3d4b en-CA -> fe959d06bc2d es-AR -> 28b70f3af7b9 es-CL -> 1a20942d1387 fr -> d6f549edda62 fy-NL -> e1da1f6274f3 gn -> cd8c32ea05dc gu-IN -> f084a3d45eee he -> 3f6345b8c45b hr -> 5fe15a6d053c hsb -> 31e154dabb67 hu -> f27490c807c9 ia -> ea3d6c7c835c id -> 9ef0ba875182 it -> 9193cea1b120 ja -> 7e846cd4b725 ja-JP-mac -> 0283a7dac647 ka -> f94e4948750a kab -> c9cc1cb4f9b8 km -> 50cd412ee3f5 lt -> 3620911d9b48 nb-NO -> 021357edcb3e nl -> 82aa032c69cf pa-IN -> 5db42eb838e7 pl -> 3060ff689d30 pt-BR -> ecf4b64812e4 sl -> ff64888d2bca sv-SE -> 1b3852e465db te -> 87e7bd312ef7 tr -> fe5e3f28d2e5 uk -> 240325308124 vi -> 1b9035c24b82 zh-CN -> 09a43445c613 zh-TW -> 31cdae99ca33

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 mozilla_unused_h
#define mozilla_unused_h

#include "mozilla/Attributes.h"
#include "mozilla/Types.h"

#ifdef __cplusplus

namespace mozilla {

//
// Suppress GCC warnings about unused return values with
//   Unused << SomeFuncDeclaredWarnUnusedReturnValue();
//
struct unused_t {
  template <typename T>
  MOZ_ALWAYS_INLINE_EVEN_DEBUG void operator<<(const T& /*unused*/) const {}
};

extern MFBT_DATA const unused_t Unused;

}  // namespace mozilla

#endif  // __cplusplus

// An alternative to mozilla::Unused for use in (a) C code and (b) code where
// linking with unused.o is difficult.
#define MOZ_UNUSED(expr) \
  do {                   \
    if (expr) {          \
      (void)0;           \
    }                    \
  } while (0)

#endif  // mozilla_unused_h