tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ConditionalCompilation.h (1358B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef DOM_QUOTA_CONDITIONALCOMPILATION_H_
      8 #define DOM_QUOTA_CONDITIONALCOMPILATION_H_
      9 
     10 #include "mozilla/dom/quota/RemoveParen.h"
     11 
     12 /**
     13 * Macros for conditional compilation based on build configuration.
     14 *
     15 * These macros are primarily used to inline debug or configuration specific
     16 * declarations or expressions in a single line without needing explicit #ifdef
     17 * blocks. This improves readability and avoids code clutter.
     18 *
     19 * Current macros include:
     20 * - DEBUGONLY(expr)
     21 * - DIAGNOSTICONLY(expr)
     22 *
     23 * This header may also include future macros such as:
     24 * - NIGHTLYONLY(expr)
     25 * - IF_NIGHTLY(expr)
     26 *
     27 * All macros in this file are designed for compile time control over code
     28 * inclusion and should not introduce runtime behavior.
     29 */
     30 
     31 #ifdef DEBUG
     32 #  define DEBUGONLY(expr) MOZ_REMOVE_PAREN(expr)
     33 #else
     34 #  define DEBUGONLY(expr)
     35 #endif
     36 
     37 #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
     38 #  define DIAGNOSTICONLY(expr) MOZ_REMOVE_PAREN(expr)
     39 #else
     40 #  define DIAGNOSTICONLY(expr)
     41 #endif
     42 
     43 #endif  // DOM_QUOTA_CONDITIONALCOMPILATION_H_