0
Files
src/ppapi/cpp/logging.h
binji@chromium.org febbb9cf55 [PPAPI] Documentation fixes.
* I added a closing </code> tag in r191189, but it seems to be more consistent
to forgo <code> tags for enums, so I've removed it.

* I've also added @code/@endcode around a snippet of code that was flattened
otherwise.

BUG=none
R=dmichael@chromium.org

Review URL: https://codereview.chromium.org/13238002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193162 0039d316-1c4b-4281-b951-d872f2087c98
2013-04-09 18:40:17 +00:00

35 lines
962 B
C

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_CPP_LOGGING_H_
#define PPAPI_CPP_LOGGING_H_
/// @file
/// This file defines two macro asserts.
#include <cassert>
/// This macro asserts that 'a' evaluates to true. In debug mode, this macro
/// will crash the program if the assertion evaluates to false. It (typically)
/// has no effect in release mode.
#define PP_DCHECK(a) assert(a)
/// This macro asserts false in debug builds. It's used in code paths that you
/// don't expect to execute.
///
/// <strong>Example:</strong>
///
/// @code
/// if (!pointer) {
/// // Pointer wasn't valid! This shouldn't happen.
/// PP_NOTREACHED();
/// return;
/// }
/// // Do stuff to the pointer, since you know it's valid.
/// pointer->DoSomething();
/// @endcode
#define PP_NOTREACHED() assert(false)
#endif // PPAPI_CPP_LOGGING_H_