Initial import of nlassert
From https://github.com/nestlabs/nlassert
at revision 700bd55d6ea6ca1bedaa2f86bc17e8c0313139aa
diff --git a/CHANGES b/CHANGES
new file mode 100644
index 0000000..c680677
--- /dev/null
+++ b/CHANGES
@@ -0,0 +1,32 @@
+1.1.6 (2019-05-24)
+
+ * Updated to nlbuild-autotools 1.6.11.
+
+1.1.5 (2019-04-30)
+
+ * Updated to nlbuild-autotools 1.6.9.
+
+1.1.4 (2019-04-09)
+
+ * Updated to nlbuild-autotools 1.6.6.
+
+1.1.3 (2018-11-19)
+
+ * Updated to nlbuild-autotools 1.6.5.
+
+1.1.2 (2018-11-15)
+
+ * Updated to nlbuild-autotools 1.6.4.
+
+1.1.1 (2018-04-26)
+
+ * Updated to nlbuild-autotools 1.5.2.
+
+1.1 (2018-04-19)
+
+ * Updated to utilize nlbuild-autotools 1.5.0, removing inlined
+ copy of nlunit-test in the process.
+
+1.0 (2017-06-28)
+
+ * First public release to Github.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..2827b7d
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,27 @@
+Want to contribute? Great! First, read this page (including the small print at the end).
+
+### Before you contribute
+Before we can use your code, you must sign the
+[Google Individual Contributor License Agreement]
+(https://cla.developers.google.com/about/google-individual)
+(CLA), which you can do online. The CLA is necessary mainly because you own the
+copyright to your changes, even after your contribution becomes part of our
+codebase, so we need your permission to use and distribute your code. We also
+need to be sure of various other things—for instance that you'll tell us if you
+know that your code infringes on other people's patents. You don't have to sign
+the CLA until after you've submitted your code for review and a member has
+approved it, but you must do it before we can put your code into our codebase.
+Before you start working on a larger contribution, you should get in touch with
+us first through the issue tracker with your idea so that we can help out and
+possibly guide you. Coordinating up front makes it much easier to avoid
+frustration later on.
+
+### Code reviews
+All submissions, including submissions by project members, require review. We
+use Github pull requests for this purpose.
+
+### The small print
+Contributions made by corporations are covered by a different agreement than
+the one above, the
+[Software Grant and Corporate Contributor License Agreement]
+(https://cla.developers.google.com/about/google-corporate).
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..209dcc8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,76 @@
+[![Build Status][nlassert-travis-svg]][nlassert-travis]
+[![Coverage Status][nlassert-codecov-svg]][nlassert-codecov]
+
+Nest Labs Assert
+================
+
+# Introduction
+
+This package defines macros and interfaces for performing both
+compile- and run-time assertion checking and run-time exception
+handling.
+
+Where exception-handing is concerned, the format of the macros are
+inspired by those found in Mac OS Classic and, later, Mac OS
+X. These, in turn, were inspired by "Living In an Exceptional
+World" by Sean Parent (develop, The Apple Technical Journal, Issue
+11, August/September 1992). See:
+
+ http://www.mactech.com/articles/develop/issue_11/Parent_final.html
+
+for the methodology behind these error handling and assertion macros.
+
+# Overview
+
+The interfaces in this package come in two interface modalities:
+
+* **Run-time** Interfaces that dynamically check a logical assertion and alter run-time execution on assertion firing.
+* **Compile-time** Interfaces that statically check a logical assertion and terminate compile-time execution on assertion firing.
+
+## Run-time
+
+The run-time modality interfaces in this package come in three
+families:
+
+* **Assertion** Similar to the traditional C Standard Library
+ [assert()](http://pubs.opengroup.org/onlinepubs/009695399/functions/assert.html).
+* **Precondition** Designed to be placed at the head of an interface or
+ method to check incoming parameters and return on assertion failure.
+* **Exception** Designed to jump to a local label on assertion failure
+ to support the method of error and exception handling that advocates
+ a single function or method return site and, by extension, consolidated
+ points of exception and error handling as well as resource clean-up.
+
+There are several styles of interfaces within each family and several
+potential variants within each style, all of which are summarized
+below and are described in detail in the following sections.
+
+## Compile-time
+
+The compile-time modality interfaces in this package are simpler and
+come in a single family with a couple of styles and variants, all
+intended to provide parallelism with the run-time interfaces.
+
+[nlassert-travis]: https://travis-ci.org/nestlabs/nlassert
+[nlassert-travis-svg]: https://travis-ci.org/nestlabs/nlassert.svg?branch=master
+[nlassert-codecov]: https://codecov.io/gh/nestlabs/nlassert
+[nlassert-codecov-svg]: https://codecov.io/gh/nestlabs/nlassert/branch/master/graph/badge.svg
+
+# Interact
+
+There are numerous avenues for nlassert support:
+
+ * Bugs and feature requests — [submit to the Issue Tracker](https://github.com/nestlabs/nlassert/issues)
+ * Google Groups — discussion and announcements
+ * [nlassert-announce](https://groups.google.com/forum/#!forum/nlassert-announce) — release notes and new updates on nlassert
+ * [nlassert-users](https://groups.google.com/forum/#!forum/nlassert-users) — discuss use of and enhancements to nlassert
+
+# Versioning
+
+nlassert follows the [Semantic Versioning guidelines](http://semver.org/)
+for release cycle transparency and to maintain backwards compatibility.
+
+# License
+
+nlassert is released under the [Apache License, Version 2.0 license](https://opensource.org/licenses/Apache-2.0).
+See the `LICENSE` file for more information.
diff --git a/include/nlassert-config.h.in b/include/nlassert-config.h.in
new file mode 100644
index 0000000..1bd1c97
--- /dev/null
+++ b/include/nlassert-config.h.in
@@ -0,0 +1,131 @@
+/* include/nlassert-config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if your C++ compiler doesn't accept -c and -o together. */
+#undef CXX_NO_MINUS_C_MINUS_O
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `memcpy' function. */
+#undef HAVE_MEMCPY
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <nlunit-test.h> header file. */
+#undef HAVE_NLUNIT_TEST_H
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Define to 1 if the Standard C Library assert() workalike should be unit
+ tested */
+#undef NLASSERT_TEST_STDC
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT64_T
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT8_T
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int16_t
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int32_t
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int64_t
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+ a type exists and the standard includes do not define it. */
+#undef int8_t
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint16_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint64_t
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint8_t
diff --git a/include/nlassert-internal.h b/include/nlassert-internal.h
new file mode 100644
index 0000000..174b37f
--- /dev/null
+++ b/include/nlassert-internal.h
@@ -0,0 +1,489 @@
+/*
+ * Copyright 2010-2016 Nest Labs Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Description:
+ * This file defines macros internal to the implementation of the
+ * Nest Labs assertion and exception checking facility.
+ *
+ */
+
+#ifndef NLASSERT_INTERNAL_H
+#define NLASSERT_INTERNAL_H
+
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
+# define __nlLIKELY(condition) __builtin_expect(condition, 1)
+# define __nlUNLIKELY(condition) __builtin_expect(condition, 0)
+#else
+# define __nlLIKELY(condition) (condition)
+# define __nlUNLIKELY(condition) (condition)
+#endif /* defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) */
+
+// Notes on the unusual design of __nlSHOULD_ASSERT and __nl_ASSERT_UNUSED:
+//
+//
+// For non-production builds (aka "development" or "debug" builds)
+// ===============================================================
+//
+// The nlASSERT(condition) macro evaluates the "condition" expression and, if
+// it is false, calls NL_ASSERT_ABORT() to abort execution (after optionally
+// performing some logging and debugging operations). Partially expanded, for
+// clarity, it looks like this:
+//
+// if (__nlSHOULD_ASSERT(condition))
+// {
+// do
+// {
+// /* optional logging, backtrace, and/or trap handling */
+// } while (0);
+//
+// {
+// NL_ASSERT_ABORT();
+// }
+// }
+// else do { /* nothing */ } while (0)
+//
+// NOTE: The "if (foo) / else do { } while (0)" construct is just a more
+// robust version of the standard "do / while (0)" macro wrapper.
+// It is explained below, in the comments accompanying __nlCHECK.
+//
+// The __nlSHOULD_ASSERT(condition) macro must evaluate to true if "condition"
+// is false; conceptually, its definition is "!(condition)". But it is not
+// actually defined that way, for this reason:
+//
+// It is not uncommon for an equality test like "if (x == y)" to be accidentally
+// written as an assignment: "if (x = y)". GCC and similar compilers can detect
+// this and emit a warning, but the warning is suppressed if the assignment is
+// surrounded by an extra pair of parentheses to indicate that it is
+// intentional: "if ((x = y))". So if __nlSHOULD_ASSERT(condition) were defined
+// as "!(condition)", the parentheses around "condition" -- required by the "!"
+// operator -- would be seen by the compiler as an indication that the
+// assignment was intentional, so no warning would be emitted if, for example,
+// "nlASSERT(x == y)" were mistakenly written as "nlASSERT(x = y)".
+//
+// Therefore, __nlSHOULD_ASSERT(condition) is defined so that there will be no
+// extra parentheses around "condition" when the nlASSERT(condition) macro is
+// expanded. With this definition, nlASSERT(condition) expands to:
+//
+// if (condition)
+// {
+// /* do nothing */
+// }
+// else if (1)
+// {
+// do
+// {
+// /* optional logging, backtrace, and/or trap handling */
+// } while (0);
+//
+// {
+// NL_ASSERT_ABORT();
+// }
+// }
+// else do { /* nothing */ } while (0)
+//
+// GCC's branch-prediction hinting mechanism ("__builtin_expect(condition,1)")
+// would also suppress the "unintended assignment" warning, so is not used in
+// the macro definition. But the macro compiles to exactly the same assembly
+// code as it would if the hint were included, so omitting the hint incurs no
+// speed or memory cost. This is true for both ARM and x86 ISAs (tested under
+// GCC 4.x.x, with optimization for speed enabled via compiler flag -O3).
+//
+//
+// For production builds (aka "release" builds)
+// ============================================
+//
+// The nlASSERT(condition) macro is disabled by defining it as
+// __nlASSERT_UNUSED(condition).
+//
+// The __nlASSERT_UNUSED(condition) macro must not perform any logging or
+// debugging operations, and it must not abort program execution even when
+// "condition" is false. It cannot simply be defined as "(void)0", however,
+// because it must allow side effects in "condition", if any, to occur exactly
+// as they would in the non-production version of the macro. And it can't be
+// defined as (void)(condition) because it is desirable for an unintended
+// assignment in "condition" to be caught by the compiler, just as it would be
+// in a non-production build.
+//
+// Therefore, __nl_ASSERT_UNUSED(condition) is defined so that "condition" is
+// treated as a truth value, to ensure that unintended assignment will be
+// caught, and so that "condition" is evaluated at runtime if and only if it
+// would also be evaluated by the non-production version of nlASSERT(condition),
+// to ensure that side effects will occur identically.
+
+#define __nlSHOULD_ASSERT(condition) condition) { /* do nothing */ } else if (1
+
+#define __nlASSERT_UNUSED(condition) do { if (condition) { /* do nothing */ } } while (0)
+
+/** @cond */
+#define __nlSTATIC_ASSERT_CONCAT(aPrefix, aSuffix) aPrefix ## aSuffix
+
+#define _nlSTATIC_ASSERT_CONCAT(aPrefix, aSuffix) __nlSTATIC_ASSERT_CONCAT(aPrefix, aSuffix)
+/** @endcond */
+
+/**
+ * @def _nlSTATIC_ASSERT(aCondition)
+ *
+ * @brief
+ * This checks, at compile-time, for the specified condition, which
+ * is expected to commonly be true and terminates compilation if the
+ * condition is false. It is legal, in both C and C++, anywhere that
+ * a declaration would be.
+ *
+ * @note This is a package-internal interface. If C++11/C11 or greater is
+ * available, this falls back to using C++11/C11 intrinsic facilities:
+ * static_assert or _Static_assert.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion
+ * failure. Note, this message is not
+ * actually emitted in any meaningful way for
+ * non-C11 or -C++11 code. It serves to
+ * simply comment or annotate the assertion
+ * and to provide interface parallelism with
+ * the run-time assertion interfaces.
+ *
+ */
+#if defined(__cplusplus) && (__cplusplus >= 201103L)
+# define _nlSTATIC_ASSERT(aCondition, aMessage) static_assert(aCondition, aMessage)
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
+# define _nlSTATIC_ASSERT(aCondition, aMessage) _Static_assert(aCondition, aMessage)
+#else
+# ifdef __COUNTER__
+# define _nlSTATIC_ASSERT(aCondition, aMessage) typedef char _nlSTATIC_ASSERT_CONCAT(STATIC_ASSERT_t_, __COUNTER__)[(aCondition) ? 1 : -1] __attribute__ ((unused))
+# else
+# define _nlSTATIC_ASSERT(aCondition, aMessage) typedef char _nlSTATIC_ASSERT_CONCAT(STATIC_ASSERT_t_, __LINE__)[(aCondition) ? 1 : -1] __attribute__ ((unused))
+# endif
+#endif /* defined(__cplusplus) && (__cplusplus >= 201103L) */
+
+// __nlSTATIC_ASSERT_UNUSED(aCondition)
+//
+// Can be used everywhere that _nlSTATIC_ASSERT can, and behaves exactly the
+// same way except that it never asserts.
+#if defined(__cplusplus) && (__cplusplus >= 201103L)
+# define __nlSTATIC_ASSERT_UNUSED(aCondition, aMessage) static_assert((aCondition) || 1, aMessage)
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
+# define __nlSTATIC_ASSERT_UNUSED(aCondition, aMessage) _Static_assert((aCondition) || 1, aMessage)
+#else
+# ifdef __COUNTER__
+# define __nlSTATIC_ASSERT_UNUSED(aCondition, aMessage) typedef char _nlSTATIC_ASSERT_CONCAT(STATIC_ASSERT_t_, __COUNTER__)[((aCondition) || 1) ? 1 : -1] __attribute__ ((unused))
+# else
+# define __nlSTATIC_ASSERT_UNUSED(aCondition, aMessage) typedef char _nlSTATIC_ASSERT_CONCAT(STATIC_ASSERT_t_, __LINE__)[((aCondition) || 1) ? 1 : -1] __attribute__ ((unused))
+# endif
+#endif /* defined(__cplusplus) && (__cplusplus >= 201103L) */
+
+#define __NL_ASSERT_MAYBE_RUN_TRIGGERS(flags, prefix, name, condition, label, file, line, message) \
+ do \
+ { \
+ if ((flags) & NL_ASSERT_FLAG_LOG) { \
+ NL_ASSERT_LOG(prefix, name, condition, label, file, line, message); \
+ } \
+ if ((flags) & NL_ASSERT_FLAG_BACKTRACE) { \
+ NL_ASSERT_BACKTRACE(); \
+ } \
+ if ((flags) & NL_ASSERT_FLAG_TRAP) { \
+ NL_ASSERT_TRAP(); \
+ } \
+ } while (0)
+
+#define __NL_ASSERT_MAYBE_RUN_PRE_ACTION_TRIGGERS(flags, prefix, name, condition, label, file, line, message) \
+ do \
+ { \
+ if ((flags) & NL_ASSERT_FLAG_LOG) { \
+ NL_ASSERT_LOG(prefix, name, condition, label, file, line, message); \
+ } \
+ if ((flags) & NL_ASSERT_FLAG_BACKTRACE) { \
+ NL_ASSERT_BACKTRACE(); \
+ } \
+ } while (0)
+
+#define __NL_ASSERT_MAYBE_RUN_POST_ACTION_TRIGGERS(flags, prefix, name, condition, label, file, line, message) \
+ do \
+ { \
+ if ((flags) & NL_ASSERT_FLAG_TRAP) { \
+ NL_ASSERT_TRAP(); \
+ } \
+ } while (0)
+
+// __nlEXPECT
+
+#define __nlEXPECT(flags, condition, label) \
+ do \
+ { \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ #label, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ 0); \
+ goto label; \
+ } \
+ } while (0)
+
+#define __nlEXPECT_PRINT(flags, condition, label, message) \
+ do \
+ { \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ #label, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ message); \
+ goto label; \
+ } \
+ } while (0)
+
+#define __nlEXPECT_ACTION(flags, condition, label, action) \
+ do \
+ { \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_PRE_ACTION_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ #label, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ 0); \
+ { \
+ action; \
+ } \
+ __NL_ASSERT_MAYBE_RUN_POST_ACTION_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ #label, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ 0); \
+ goto label; \
+ } \
+ } while (0)
+
+#define __nlEXPECT_ACTION_PRINT(flags, condition, label, action, message) \
+ do \
+ { \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_PRE_ACTION_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ #label, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ message); \
+ { \
+ action; \
+ } \
+ __NL_ASSERT_MAYBE_RUN_POST_ACTION_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ #label, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ message); \
+ goto label; \
+ } \
+ } while (0)
+
+#define __nlEXPECT_SUCCESS(flags, status, label) __nlEXPECT(flags, status == 0, label)
+#define __nlEXPECT_SUCCESS_PRINT(flags, status, label, message) __nlEXPECT_PRINT(flags, status == 0, label, message)
+#define __nlEXPECT_SUCCESS_ACTION(flags, status, label, action) __nlEXPECT_ACTION(flags, status == 0, label, action)
+#define __nlEXPECT_SUCCESS_ACTION_PRINT(flags, status, label, action, message) __nlEXPECT_ACTION_PRINT(flags, status == 0, label, action, message)
+
+#define __nlNEXPECT(flags, condition, label) __nlEXPECT(flags, !(condition), label)
+#define __nlNEXPECT_PRINT(flags, condition, label, message) __nlEXPECT_PRINT(flags, !(condition), label, message)
+#define __nlNEXPECT_ACTION(flags, condition, label, action) __nlEXPECT_ACTION(flags, !(condition), label, action)
+#define __nlNEXPECT_ACTION_PRINT(flags, condition, label, action, message) __nlEXPECT_ACTION_PRINT(flags, !(condition), label, action, message)
+
+// __nlCHECK
+//
+// NOTE: Some of these macros take a C statement as a parameter. The unusual
+// "else do {} while(0)" construct allows those macros to work properly when
+// that parameter is set to "continue" or "break" (which isn't unexpected in
+// an assert macro).
+//
+// If the macros were written in the standard way by wrapping them in a
+// "do/while(0)", they could fail silently: A "continue" or "break" statement,
+// intended to break out of one or all iterations of the loop containing the
+// macro invocation -- would instead just break out of the macro's internal
+// do-while.
+
+#define __nlCHECK(flags, condition) \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ 0, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ 0); \
+ } \
+ else do {} while (0)
+
+#define __nlCHECK_ACTION(flags, condition, action) \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_PRE_ACTION_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ 0, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ 0); \
+ { \
+ action; \
+ } \
+ __NL_ASSERT_MAYBE_RUN_POST_ACTION_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ 0, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ 0); \
+ } \
+ else do {} while (0) /* This is explained in the comment above __nlCHECK */
+
+#define __nlCHECK_PRINT(flags, condition, message) \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ 0, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ message); \
+ } \
+ else do {} while (0) /* This is explained in the comment above __nlCHECK */
+
+#define __nlCHECK_SUCCESS(flags, status) __nlCHECK(flags, status == 0)
+#define __nlCHECK_SUCCESS_ACTION(flags, status, action) __nlCHECK_ACTION(flags, status == 0, action)
+#define __nlCHECK_SUCCESS_PRINT(flags, status, message) __nlCHECK_PRINT(flags, status == 0, message)
+
+#define __nlNCHECK(flags, condition) __nlCHECK(flags, !(condition))
+#define __nlNCHECK_ACTION(flags, condition, action) __nlCHECK_ACTION(flags, !(condition), action)
+#define __nlNCHECK_PRINT(flags, condition, message) __nlCHECK_PRINT(flags, !(condition), message)
+
+// __nlVERIFY
+
+#define __nlVERIFY(flags, condition) __nlCHECK(flags, condition)
+#define __nlVERIFY_ACTION(flags, condition, action) __nlCHECK_ACTION(flags, condition, action)
+#define __nlVERIFY_PRINT(flags, condition, message) __nlCHECK_PRINT(flags, condition, message)
+
+#define __nlVERIFY_SUCCESS(flags, status) __nlCHECK_SUCCESS(flags, status)
+#define __nlVERIFY_SUCCESS_ACTION(flags, status, action) __nlCHECK_SUCCESS_ACTION(flags, status, action)
+#define __nlVERIFY_SUCCESS_PRINT(flags, status, message) __nlCHECK_SUCCESS_PRINT(flags, status, message)
+
+#define __nlNVERIFY(flags, condition) __nlNCHECK(flags, condition)
+#define __nlNVERIFY_ACTION(flags, condition, action) __nlNCHECK_ACTION(flags, condition, action)
+#define __nlNVERIFY_PRINT(flags, condition, message) __nlNCHECK_PRINT(flags, condition, message)
+
+// __nlPRECONDITION
+
+#define __nlPRECONDITION(flags, condition, termination) \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ 0, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ 0); \
+ { \
+ termination; \
+ } \
+ } \
+ else do {} while (0) /* This is explained in the comment above __nlCHECK */
+
+#define __nlPRECONDITION_ACTION(flags, condition, termination, action) \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_PRE_ACTION_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ 0, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ 0); \
+ { \
+ action; \
+ } \
+ __NL_ASSERT_MAYBE_RUN_POST_ACTION_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ 0, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ 0); \
+ { \
+ termination; \
+ } \
+ } \
+ else do {} while (0) /* This is explained in the comment above __nlCHECK */
+
+#define __nlPRECONDITION_PRINT(flags, condition, termination, message) \
+ if (__nlSHOULD_ASSERT(condition)) \
+ { \
+ __NL_ASSERT_MAYBE_RUN_TRIGGERS((flags), \
+ NL_ASSERT_PREFIX_STRING, \
+ NL_ASSERT_COMPONENT_STRING, \
+ #condition, \
+ 0, \
+ NL_ASSERT_FILE, \
+ __LINE__, \
+ message); \
+ { \
+ termination; \
+ } \
+ } \
+ else do {} while (0) /* This is explained in the comment above __nlCHECK */
+
+#define __nlPRECONDITION_SUCCESS(flags, status, termination) __nlPRECONDITION(flags, status == 0, termination)
+#define __nlPRECONDITION_SUCCESS_ACTION(flags, status, termination, action) __nlPRECONDITION_ACTION(flags, status == 0, termination, action)
+#define __nlPRECONDITION_SUCCESS_PRINT(flags, status, termination, message) __nlPRECONDITION_PRINT(flags, status == 0, termination, message)
+
+#define __nlNPRECONDITION(flags, condition, termination) __nlPRECONDITION(flags, !(condition), termination)
+#define __nlNPRECONDITION_ACTION(flags, condition, termination, action) __nlPRECONDITION_ACTION(flags, !(condition), termination, action)
+#define __nlNPRECONDITION_PRINT(flags, condition, termination, message) __nlPRECONDITION_PRINT(flags, !(condition), termination, message)
+
+// __nlABORT
+
+#define __nlABORT(flags, condition) __nlPRECONDITION(flags, condition, NL_ASSERT_ABORT())
+
+#define __nlABORT_ACTION(flags, condition, action) __nlPRECONDITION_ACTION(flags, condition, NL_ASSERT_ABORT(), action)
+
+#endif /* NLASSERT_INTERNAL_H */
diff --git a/include/nlassert-nonproduction.h b/include/nlassert-nonproduction.h
new file mode 100644
index 0000000..9c1d653
--- /dev/null
+++ b/include/nlassert-nonproduction.h
@@ -0,0 +1,2143 @@
+/*
+ * Copyright 2010-2016 Nest Labs Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * @file
+ * This file defines macros and interfaces for performing
+ * compile- and run-time assertion checking and run-time
+ * exception handling when #NL_ASSERT_PRODUCTION is false.
+ *
+ */
+
+#ifndef NLCORE_NLASSERT_NONPRODUCTION_H
+#define NLCORE_NLASSERT_NONPRODUCTION_H
+
+#include "nlassert-internal.h"
+
+/**
+ * @ingroup check-style
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_CHECK_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for check-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * disabled.
+ *
+ * This may be used to override #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_CHECK_NONPRODUCTION_FLAGS NL_ASSERT_CHECK_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#define NL_ASSERT_CHECK_NONPRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG | NL_ASSERT_FLAG_TRAP)
+
+/**
+ * @def NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * disabled that govern the behavior for check-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_CHECK_NONPRODUCTION_FLAGS NL_ASSERT_CHECK_NONPRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS)
+#define NL_ASSERT_CHECK_NONPRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @def nlCHECK(aCondition)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, if
+ * the condition is false.
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlVERIFY
+ *
+ */
+#define nlCHECK(aCondition) __nlCHECK(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS, aCondition)
+
+/**
+ * @def nlCHECK_ACTION(aCondition, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, and
+ * executes @p anAction if the condition is false.
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlVERIFY_ACTION
+ *
+ */
+#define nlCHECK_ACTION(aCondition, anAction) __nlCHECK_ACTION(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS, aCondition, anAction)
+
+/**
+ * @def nlCHECK_PRINT(aCondition, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, and
+ * prints @p aMessage if the condition is false.
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlVERIFY_PRINT
+ *
+ */
+#define nlCHECK_PRINT(aCondition, aMessage) __nlCHECK_PRINT(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS, aCondition, aMessage)
+
+/**
+ * @def nlCHECK_SUCCESS(aStatus)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)) and takes action, based
+ * on configuration, if the status is unsuccessful.
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlVERIFY_SUCCESS
+ *
+ */
+#define nlCHECK_SUCCESS(aStatus) __nlCHECK_SUCCESS(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS, aStatus)
+
+/**
+ * @def nlCHECK_SUCCESS_ACTION(aStatus, anAction)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)) and takes action, based
+ * on configuration, and executes @p anAction if the status is
+ * unsuccessful.
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlVERIFY_SUCCESS_ACTION
+ *
+ */
+#define nlCHECK_SUCCESS_ACTION(aStatus, anAction) __nlCHECK_SUCCESS_ACTION(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS, aStatus, anAction)
+
+/**
+ * @def nlCHECK_SUCCESS_PRINT(aStatus, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)) and takes action, based
+ * on configuration, and prints @p aMessage if the status is
+ * unsuccessful.
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlVERIFY_SUCCESS_PRINT
+ *
+ */
+#define nlCHECK_SUCCESS_PRINT(aStatus, aMessage) __nlCHECK_SUCCESS_PRINT(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS, aStatus, aMessage)
+
+/**
+ * @def nlNCHECK(aCondition)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false and takes action, based on configuration, if
+ * the condition is true.
+ *
+ * @note This is the logical inverse of #nlCHECK
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK
+ * @sa #nlNVERIFY
+ *
+ */
+#define nlNCHECK(aCondition) __nlNCHECK(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS, aCondition)
+
+/**
+ * @def nlNCHECK_ACTION(aCondition, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false and takes action, based on configuration, and
+ * executes @p anAction if the condition is true.
+ *
+ * @note This is the logical inverse of #nlCHECK_ACTION
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK_ACTION
+ * @sa #nlNVERIFY_ACTION
+ *
+ */
+#define nlNCHECK_ACTION(aCondition, anAction) __nlNCHECK_ACTION(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS, aCondition, anAction)
+
+/**
+ * @def nlNCHECK_PRINT(aCondition, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false and takes action, based on configuration, and
+ * prints @p aMessage if the condition is true.
+ *
+ * @note This is the logical inverse of #nlCHECK_PRINT
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK_PRINT
+ * @sa #nlNVERIFY_PRINT
+ *
+ */
+#define nlNCHECK_PRINT(aCondition, aMessage) __nlNCHECK_PRINT(NL_ASSERT_CHECK_NONPRODUCTION_FLAGS, aCondition, aMessage)
+
+/**
+ * @}
+ *
+ */
+
+/**
+ * @ingroup verify-style
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for verify-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * disabled.
+ *
+ * This may be used to override #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#define NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG | NL_ASSERT_FLAG_TRAP)
+
+/**
+ * @def NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * disabled that govern the behavior for verify-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS)
+#define NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @def nlVERIFY(aCondition)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, if
+ * the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK
+ *
+ */
+#define nlVERIFY(aCondition) __nlVERIFY(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS, aCondition)
+
+/**
+ * @def nlVERIFY_ACTION(aCondition, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, and
+ * executes @p anAction if the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK_ACTION
+ *
+ */
+#define nlVERIFY_ACTION(aCondition, anAction) __nlVERIFY_ACTION(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS, aCondition, anAction)
+
+/**
+ * @def nlVERIFY_PRINT(aCondition, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, and
+ * prints @p aMessage if the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK_PRINT
+ *
+ */
+#define nlVERIFY_PRINT(aCondition, aMessage) __nlVERIFY_PRINT(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS, aCondition, aMessage)
+
+/**
+ * @def nlVERIFY_SUCCESS(aStatus)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)) and takes action, based
+ * on configuration, if the status is unsuccessful.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK_SUCCESS
+ *
+ */
+#define nlVERIFY_SUCCESS(aStatus) __nlVERIFY_SUCCESS(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS, aStatus)
+
+/**
+ * @def nlVERIFY_SUCCESS_ACTION(aStatus, anAction)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)) and takes action, based
+ * on configuration, and executes @p anAction if the status is
+ * unsuccessful.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK_SUCCESS_ACTION
+ *
+ */
+#define nlVERIFY_SUCCESS_ACTION(aStatus, anAction) __nlVERIFY_SUCCESS_ACTION(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS, aStatus, anAction)
+
+/**
+ * @def nlVERIFY_SUCCESS_PRINT(aStatus, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)) and takes action, based
+ * on configuration, and prints @p aMessage if the status is
+ * unsuccessful.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK_SUCCESS_PRINT
+ *
+ */
+#define nlVERIFY_SUCCESS_PRINT(aStatus, aMessage) __nlVERIFY_SUCCESS_PRINT(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS, aStatus, aMessage)
+
+/**
+ * @def nlNVERIFY(aCondition)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false and takes action, based on configuration, if
+ * the condition is true.
+ *
+ * @note This is the logical inverse of #nlVERIFY
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #nlVERIFY
+ * @sa #nlNCHECK
+ *
+ */
+#define nlNVERIFY(aCondition) __nlNVERIFY(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS, aCondition)
+
+/**
+ * @def nlNVERIFY_ACTION(aCondition, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false and takes action, based on configuration, and
+ * executes @p anAction if the condition is true.
+ *
+ * @note This is the logical inverse of #nlVERIFY_ACTION
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #nlVERIFY_ACTION
+ * @sa #nlNCHECK_ACTION
+ *
+ */
+#define nlNVERIFY_ACTION(aCondition, anAction) __nlNVERIFY_ACTION(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS, aCondition, anAction)
+
+/**
+ * @def nlNVERIFY_PRINT(aCondition, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false and takes action, based on configuration, and
+ * prints @p aMessage if the condition is true.
+ *
+ * @note This is the logical inverse of #nlVERIFY_PRINT
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #nlVERIFY_PRINT
+ * @sa #nlNCHECK_PRINT
+ *
+ */
+#define nlNVERIFY_PRINT(aCondition, aMessage) __nlNVERIFY_PRINT(NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS, aCondition, aMessage)
+
+/**
+ * @}
+ *
+ */
+
+/**
+ * @ingroup desire-style
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for desire-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * disabled.
+ *
+ * This may be used to override #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#define NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_LOG)
+
+/**
+ * @def NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * disabled that govern the behavior for desire-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS)
+#define NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @def nlDESIRE(aCondition, aLabel)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and branches to @p aLabel if the condition is
+ * false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT
+ * @sa #nlREQUIRE
+ *
+ */
+#define nlDESIRE(aCondition, aLabel) __nlEXPECT(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aCondition, aLabel)
+
+/**
+ * @def nlDESIRE_PRINT(aCondition, aLabel, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both prints @p aMessage and then branches
+ * to @p aLabel if the condition is false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_PRINT
+ * @sa #nlREQUIRE_PRINT
+ *
+ */
+#define nlDESIRE_PRINT(aCondition, aLabel, aMessage) __nlEXPECT_PRINT(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @def nlDESIRE_ACTION(aCondition, aLabel, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both executes @p anAction and branches to
+ * @p aLabel if the condition is false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_ACTION
+ * @sa #nlREQUIRE_ACTION
+ *
+ */
+#define nlDESIRE_ACTION(aCondition, aLabel, anAction) __nlEXPECT_ACTION(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @def nlDESIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, prints @p aMessage, executes @p anAction, and
+ * branches to @p aLabel if the condition is false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_ACTION_PRINT
+ * @sa #nlREQUIRE_ACTION_PRINT
+ *
+ */
+#define nlDESIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlEXPECT_ACTION_PRINT(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+/**
+ * @def nlDESIRE_SUCCESS(aStatus, aLabel)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and branches to @p
+ * aLabel if the status is unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS
+ * @sa #nlREQUIRE_SUCCESS
+ *
+ */
+#define nlDESIRE_SUCCESS(aStatus, aLabel) __nlEXPECT_SUCCESS(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aStatus, aLabel)
+
+/**
+ * @def nlDESIRE_SUCCESS_PRINT(aStatus, aLabel, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both prints @p
+ * aMessage and then branches to @p aLabel if the status is
+ * unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_PRINT
+ * @sa #nlREQUIRE_SUCCESS_PRINT
+ *
+ */
+#define nlDESIRE_SUCCESS_PRINT(aStatus, aLabel, aMessage) __nlEXPECT_SUCCESS_PRINT(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aStatus, aLabel, aMessage)
+
+/**
+ * @def nlDESIRE_SUCCESS_ACTION(aStatus, aLabel, anAction)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both executes @p
+ * anAction and branches to @p aLabel if the status is
+ * unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_ACTION
+ * @sa #nlREQUIRE_SUCCESS_ACTION
+ *
+ */
+#define nlDESIRE_SUCCESS_ACTION(aStatus, aLabel, anAction) __nlEXPECT_SUCCESS_ACTION(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aStatus, aLabel, anAction)
+
+/**
+ * @def nlDESIRE_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), prints @p aMessage,
+ * executes @p anAction, and branches to @p aLabel if the status is
+ * unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_ACTION_PRINT
+ * @sa #nlREQUIRE_SUCCESS_ACTION_PRINT
+ *
+ */
+#define nlDESIRE_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage) __nlEXPECT_SUCCESS_ACTION_PRINT(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aStatus, aLabel, anAction, aMessage)
+
+/**
+ * @def nlNDESIRE(aCondition, aLabel)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and branches to @p aLabel if the condition is
+ * true.
+ *
+ * @note This is the logical inverse of #nlDESIRE.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlDESIRE
+ * @sa #nlNEXPECT
+ * @sa #nlNREQUIRE
+ *
+ */
+#define nlNDESIRE(aCondition, aLabel) __nlNEXPECT(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aCondition, aLabel)
+
+/**
+ * @def nlNDESIRE_PRINT(aCondition, aLabel, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both prints @p aMessage and then branches
+ * to @p aLabel if the condition is true.
+ *
+ * @note This is the logical inverse of #nlDESIRE_PRINT.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlDESIRE_PRINT
+ * @sa #nlNEXPECT_PRINT
+ * @sa #nlNREQUIRE_PRINT
+ *
+ */
+#define nlNDESIRE_PRINT(aCondition, aLabel, aMessage) __nlNEXPECT_PRINT(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @def nlNDESIRE_ACTION(aCondition, aLabel, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both executes @p anAction and branches to
+ * @p aLabel if the condition is true.
+ *
+ * @note This is the logical inverse of #nlDESIRE_ACTION.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlDESIRE_ACTION
+ * @sa #nlNEXPECT_ACTION
+ * @sa #nlNREQUIRE_ACTION
+ *
+ */
+#define nlNDESIRE_ACTION(aCondition, aLabel, anAction) __nlNEXPECT_ACTION(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @def nlNDESIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, prints @p aMessage, executes @p anAction, and
+ * branches to @p aLabel if the condition is true.
+ *
+ * @note This is the logical inverse of #nlDESIRE_ACTION_PRINT.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlDESIRE_ACTION_PRINT
+ * @sa #nlNEXPECT_ACTION_PRINT
+ * @sa #nlNREQUIRE_ACTION_PRINT
+ *
+ */
+#define nlNDESIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlNEXPECT_ACTION_PRINT(NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+/**
+ * @}
+ *
+ */
+
+/**
+ * @ingroup require-style
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for require-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * disabled.
+ *
+ * This may be used to override #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#define NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG | NL_ASSERT_FLAG_TRAP)
+
+/**
+ * @def NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * disabled that govern the behavior for require-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS)
+#define NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @def nlREQUIRE(aCondition, aLabel)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and branches to @p aLabel if the condition is
+ * false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT
+ * @sa #nlDESIRE
+ *
+ */
+#define nlREQUIRE(aCondition, aLabel) __nlEXPECT(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aCondition, aLabel)
+
+/**
+ * @def nlREQUIRE_PRINT(aCondition, aLabel, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both prints @p aMessage and then branches
+ * to @p aLabel if the condition is false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_PRINT
+ * @sa #nlDESIRE_PRINT
+ *
+ */
+#define nlREQUIRE_PRINT(aCondition, aLabel, aMessage) __nlEXPECT_PRINT(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @def nlREQUIRE_ACTION(aCondition, aLabel, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both executes @p anAction and branches to
+ * @p aLabel if the condition is false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_ACTION
+ * @sa #nlDESIRE_ACTION
+ *
+ */
+#define nlREQUIRE_ACTION(aCondition, aLabel, anAction) __nlEXPECT_ACTION(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @def nlREQUIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, prints @p aMessage, executes @p anAction, and
+ * branches to @p aLabel if the condition is false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_ACTION_PRINT
+ * @sa #nlDESIRE_ACTION_PRINT
+ *
+ */
+#define nlREQUIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlEXPECT_ACTION_PRINT(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+/**
+ * @def nlREQUIRE_SUCCESS(aStatus, aLabel)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and branches to @p
+ * aLabel if the status is unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS
+ * @sa #nlDESIRE_SUCCESS
+ *
+ */
+#define nlREQUIRE_SUCCESS(aStatus, aLabel) __nlEXPECT_SUCCESS(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aStatus, aLabel)
+
+/**
+ * @def nlREQUIRE_SUCCESS_PRINT(aStatus, aLabel, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both prints @p
+ * aMessage and then branches to @p aLabel if the status is
+ * unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_PRINT
+ * @sa #nlDESIRE_SUCCESS_PRINT
+ *
+ */
+#define nlREQUIRE_SUCCESS_PRINT(aStatus, aLabel, aMessage) __nlEXPECT_SUCCESS_PRINT(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aStatus, aLabel, aMessage)
+
+/**
+ * @def nlREQUIRE_SUCCESS_ACTION(aStatus, aLabel, anAction)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both executes @p
+ * anAction and branches to @p aLabel if the status is
+ * unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_ACTION
+ * @sa #nlDESIRE_SUCCESS_ACTION
+ *
+ */
+#define nlREQUIRE_SUCCESS_ACTION(aStatus, aLabel, anAction) __nlEXPECT_SUCCESS_ACTION(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aStatus, aLabel, anAction)
+
+/**
+ * @def nlREQUIRE_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), prints @p aMessage,
+ * executes @p anAction, and branches to @p aLabel if the status is
+ * unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_ACTION_PRINT
+ * @sa #nlDESIRE_SUCCESS_ACTION_PRINT
+ *
+ */
+#define nlREQUIRE_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage) __nlEXPECT_SUCCESS_ACTION_PRINT(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aStatus, aLabel, anAction, aMessage)
+
+/**
+ * @def nlNREQUIRE(aCondition, aLabel)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and branches to @p aLabel if the condition is
+ * true.
+ *
+ * @note This is the logical inverse of #nlREQUIRE.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlREQUIRE
+ * @sa #nlNEXPECT
+ * @sa #nlNDESIRE
+ *
+ */
+#define nlNREQUIRE(aCondition, aLabel) __nlNEXPECT(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aCondition, aLabel)
+
+/**
+ * @def nlNREQUIRE_PRINT(aCondition, aLabel, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both prints @p aMessage and then branches
+ * to @p aLabel if the condition is true.
+ *
+ * @note This is the logical inverse of #nlREQUIRE_PRINT.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlREQUIRE_PRINT
+ * @sa #nlNEXPECT_PRINT
+ * @sa #nlNDESIRE_PRINT
+ *
+ */
+#define nlNREQUIRE_PRINT(aCondition, aLabel, aMessage) __nlNEXPECT_PRINT(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @def nlNREQUIRE_ACTION(aCondition, aLabel, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both executes @p anAction and branches to
+ * @p aLabel if the condition is true.
+ *
+ * @note This is the logical inverse of #nlREQUIRE_ACTION.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlREQUIRE_ACTION
+ * @sa #nlNEXPECT_ACTION
+ * @sa #nlNDESIRE_ACTION
+ *
+ */
+#define nlNREQUIRE_ACTION(aCondition, aLabel, anAction) __nlNEXPECT_ACTION(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @def nlNREQUIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, prints @p aMessage, executes @p anAction, and
+ * branches to @p aLabel if the condition is true.
+ *
+ * @note This is the logical inverse of #nlREQUIRE_ACTION_PRINT.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #nlREQUIRE_ACTION_PRINT
+ * @sa #nlNEXPECT_ACTION_PRINT
+ * @sa #nlNDESIRE_ACTION_PRINT
+ *
+ */
+#define nlNREQUIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlNEXPECT_ACTION_PRINT(NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+/**
+ * @}
+ *
+ */
+
+/**
+ * @ingroup precondition-style
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for precondition-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * disabled.
+ *
+ * This may be used to override #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#define NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG | NL_ASSERT_FLAG_TRAP)
+
+/**
+ * @def NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * disabled that govern the behavior for precondition-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS)
+#define NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @def nlPRECONDITION(aCondition)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and returns from the enclosing function if the
+ * condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT
+ * @sa #nlDESIRE
+ * @sa #nlREQUIRE
+ *
+ */
+#define nlPRECONDITION(aCondition) __nlPRECONDITION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return)
+
+/**
+ * @def nlPRECONDITION_ACTION(aCondition, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both executes @p anAction and returns from
+ * the enclosing function if the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_ACTION
+ * @sa #nlDESIRE_ACTION
+ * @sa #nlREQUIRE_ACTION
+ *
+ */
+#define nlPRECONDITION_ACTION(aCondition, anAction) __nlPRECONDITION_ACTION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return, anAction)
+
+/**
+ * @def nlPRECONDITION_PRINT(aCondition, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both prints @p aMessage and then returns
+ * from the enclosing function if the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_PRINT
+ * @sa #nlDESIRE_PRINT
+ * @sa #nlREQUIRE_PRINT
+ *
+ */
+#define nlPRECONDITION_PRINT(aCondition, aMessage) __nlPRECONDITION_PRINT(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return, aMessage)
+
+/**
+ * @def nlPRECONDITION_SUCCESS(aStatus)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and returns from the
+ * enclosing function if the status is unsuccessful.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS
+ * @sa #nlDESIRE_SUCCESS
+ * @sa #nlREQUIRE_SUCCESS
+ *
+ */
+#define nlPRECONDITION_SUCCESS(aStatus) __nlPRECONDITION_SUCCESS(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aStatus, return)
+
+/**
+ * @def nlPRECONDITION_SUCCESS_ACTION(aStatus, anAction)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both executes @p
+ * anAction and returns from the enclosing function if the status
+ * is unsuccessful.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_ACTION
+ * @sa #nlDESIRE_SUCCESS_ACTION
+ * @sa #nlREQUIRE_SUCCESS_ACTION
+ *
+ */
+#define nlPRECONDITION_SUCCESS_ACTION(aStatus, anAction) __nlPRECONDITION_SUCCESS_ACTION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aStatus, return, anAction)
+
+/**
+ * @def nlPRECONDITION_SUCCESS_PRINT(aStatus, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both prints @p
+ * aMessage and then returns from the enclosing function if the
+ * status is unsuccessful.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_PRINT
+ * @sa #nlDESIRE_SUCCESS_PRINT
+ * @sa #nlREQUIRE_SUCCESS_PRINT
+ *
+ */
+#define nlPRECONDITION_SUCCESS_PRINT(aStatus, aMessage) __nlPRECONDITION_SUCCESS_PRINT(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aStatus, return, aMessage)
+
+/**
+ * @def nlNPRECONDITION(aCondition)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and returns from the enclosing function if
+ * the condition is true.
+ *
+ * @note This is the logical inverse of #nlPRECONDITION.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlPRECONDITION
+ *
+ * @sa #nlNEXPECT
+ * @sa #nlNDESIRE
+ * @sa #nlNREQUIRE
+ *
+ */
+#define nlNPRECONDITION(aCondition) __nlNPRECONDITION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return)
+
+/**
+ * @def nlNPRECONDITION_ACTION(aCondition, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both executes @p anAction and returns from
+ * the enclosing function if the condition is true.
+ *
+ * @note This is the logical inverse of #nlPRECONDITION_ACTION.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlPRECONDITION_ACTION
+ *
+ * @sa #nlNEXPECT_ACTION
+ * @sa #nlNDESIRE_ACTION
+ * @sa #nlNREQUIRE_ACTION
+ *
+ */
+#define nlNPRECONDITION_ACTION(aCondition, anAction) __nlNPRECONDITION_ACTION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return, anAction)
+
+/**
+ * @def nlNPRECONDITION_PRINT(aCondition, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both prints @p aMessage and then returns
+ * from the enclosing function if the condition is true.
+ *
+ * @note This is the logical inverse of #nlPRECONDITION_PRINT.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlPRECONDITION_PRINT
+ *
+ * @sa #nlNEXPECT_PRINT
+ * @sa #nlNDESIRE_PRINT
+ * @sa #nlNREQUIRE_PRINT
+ *
+ */
+#define nlNPRECONDITION_PRINT(aCondition, aMessage) __nlNPRECONDITION_PRINT(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return, aMessage)
+
+/**
+ * @def nlPRECONDITION_VALUE(aCondition, aValue)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and returns @p aValue from the enclosing
+ * function if the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aValue The value to be returned when the assertion
+ * fails.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT
+ * @sa #nlDESIRE
+ * @sa #nlREQUIRE
+ *
+ */
+#define nlPRECONDITION_VALUE(aCondition, aValue) __nlPRECONDITION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return aValue)
+
+/**
+ * @def nlPRECONDITION_VALUE_ACTION(aCondition, aValue, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both executes @p anAction and returns @p
+ * aValue from the enclosing function if the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aValue The value to be returned when the assertion
+ * fails.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_ACTION
+ * @sa #nlDESIRE_ACTION
+ * @sa #nlREQUIRE_ACTION
+ *
+ */
+#define nlPRECONDITION_VALUE_ACTION(aCondition, aValue, anAction) __nlPRECONDITION_ACTION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return aValue, anAction)
+
+/**
+ * @def nlPRECONDITION_VALUE_PRINT(aCondition, aValue, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both prints @p aMessage and then returns
+ * @p aValue from the enclosing function if the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aValue The value to be returned when the assertion
+ * fails.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_PRINT
+ * @sa #nlDESIRE_PRINT
+ * @sa #nlREQUIRE_PRINT
+ *
+ */
+#define nlPRECONDITION_VALUE_PRINT(aCondition, aValue, aMessage) __nlPRECONDITION_PRINT(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return aValue, aMessage)
+
+/**
+ * @def nlPRECONDITION_VALUE_SUCCESS(aStatus, aValue)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and returns @p aValue
+ * from the enclosing function if the status is unsuccessful.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aValue The value to be returned when the assertion
+ * fails.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS
+ * @sa #nlDESIRE_SUCCESS
+ * @sa #nlREQUIRE_SUCCESS
+ *
+ */
+#define nlPRECONDITION_VALUE_SUCCESS(aStatus, aValue) __nlPRECONDITION_SUCCESS(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aStatus, return aValue)
+
+/**
+ * @def nlPRECONDITION_VALUE_SUCCESS_ACTION(aStatus, aValue, anAction)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both executes @p
+ * anAction and returns @p aValue from the enclosing function if
+ * the status is unsuccessful.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aValue The value to be returned when the assertion
+ * fails.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_ACTION
+ * @sa #nlDESIRE_SUCCESS_ACTION
+ * @sa #nlREQUIRE_SUCCESS_ACTION
+ *
+ */
+#define nlPRECONDITION_VALUE_SUCCESS_ACTION(aStatus, aValue, anAction) __nlPRECONDITION_SUCCESS_ACTION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aStatus, return aValue, anAction)
+
+/**
+ * @def nlPRECONDITION_VALUE_SUCCESS_PRINT(aStatus, aValue, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both prints @p
+ * aMessage and then returns @p aValue from the enclosing function
+ * if the status is unsuccessful.
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aValue The value to be returned when the assertion
+ * fails.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlEXPECT_SUCCESS_PRINT
+ * @sa #nlDESIRE_SUCCESS_PRINT
+ * @sa #nlREQUIRE_SUCCESS_PRINT
+ *
+ */
+#define nlPRECONDITION_VALUE_SUCCESS_PRINT(aStatus, aValue, aMessage) __nlPRECONDITION_SUCCESS_PRINT(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aStatus, return aValue, aMessage)
+
+/**
+ * @def nlNPRECONDITION_VALUE(aCondition, aValue)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and returns @p aValue from the enclosing
+ * function if the condition is true.
+ *
+ * @note This is the logical inverse of #nlPRECONDITION_VALUE.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aValue The value to be returned when the assertion
+ * fails.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlPRECONDITION_VALUE
+ *
+ * @sa #nlNEXPECT
+ * @sa #nlNDESIRE
+ * @sa #nlNREQUIRE
+ *
+ */
+#define nlNPRECONDITION_VALUE(aCondition, aValue) __nlNPRECONDITION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return aValue)
+
+/**
+ * @def nlNPRECONDITION_VALUE_ACTION(aCondition, aValue, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both executes @p anAction and returns @p
+ * aValue from the enclosing function if the condition is true.
+ *
+ * @note This is the logical inverse of #nlPRECONDITION_VALUE_ACTION.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aValue The value to be returned when the assertion
+ * fails.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlPRECONDITION_VALUE_ACTION
+ *
+ * @sa #nlNEXPECT_ACTION
+ * @sa #nlNDESIRE_ACTION
+ * @sa #nlNREQUIRE_ACTION
+ *
+ */
+#define nlNPRECONDITION_VALUE_ACTION(aCondition, aValue, anAction) __nlNPRECONDITION_ACTION(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return aValue, anAction)
+
+/**
+ * @def nlNPRECONDITION_VALUE_PRINT(aCondition, aValue, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both prints @p aMessage and then returns
+ * @p aValue from the enclosing function if the condition is true.
+ *
+ * @note This is the logical inverse of #nlPRECONDITION_VALUE_PRINT.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aValue The value to be returned when the assertion
+ * fails.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #nlPRECONDITION_VALUE_PRINT
+ *
+ * @sa #nlNEXPECT_PRINT
+ * @sa #nlNDESIRE_PRINT
+ * @sa #nlNREQUIRE_PRINT
+ *
+ */
+#define nlNPRECONDITION_VALUE_PRINT(aCondition, aValue, aMessage) __nlNPRECONDITION_PRINT(NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS, aCondition, return aValue, aMessage)
+
+/**
+ * @}
+ *
+ */
+
+/**
+ * @ingroup assert-style
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for assert-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * disabled.
+ *
+ * This may be used to override #NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#define NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG)
+
+/**
+ * @def NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * disabled that govern the behavior for assert-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS)
+#define NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @def nlASSERT(aCondition)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, and
+ * invokes #NL_ASSERT_ABORT() if the condition is false.
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ *
+ * @sa #NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK
+ * @sa #nlVERIFY
+ * @sa #nlABORT
+ *
+ */
+#define nlASSERT(aCondition) __nlABORT(NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS, aCondition)
+
+/**
+ * @def nlASSERT_ACTION(aCondition, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, and
+ * both executes @p anAction and then invokes #NL_ASSERT_ABORT() if
+ * the condition is false.
+ *
+ * @note If #NL_ASSERT_PRODUCTION is true, the check is made inactive. But
+ * side-effects, if any, in the asserted expression will still be produced.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK_ACTION
+ * @sa #nlVERIFY_ACTION
+ * @sa #nlABORT_ACTION
+ *
+ */
+#define nlASSERT_ACTION(aCondition, anAction) __nlABORT_ACTION(NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS, aCondition, anAction)
+
+/**
+ * @}
+ *
+ */
+
+/**
+ * @ingroup abort-style
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_ABORT_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for abort-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * disabled.
+ *
+ * This may be used to override #NL_ASSERT_ABORT_NONPRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_ABORT_NONPRODUCTION_FLAGS NL_ASSERT_ABORT_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_ABORT_NONPRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#define NL_ASSERT_ABORT_NONPRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG)
+
+/**
+ * @def NL_ASSERT_ABORT_NONPRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * disabled that govern the behavior for abort-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_ABORT_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_ABORT_NONPRODUCTION_FLAGS NL_ASSERT_ABORT_NONPRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_ABORT_NONPRODUCTION_FLAGS)
+#define NL_ASSERT_ABORT_NONPRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @def nlABORT(aCondition)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, and
+ * invokes #NL_ASSERT_ABORT() if the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ *
+ * @sa #NL_ASSERT_ABORT_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_ABORT_PRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK
+ * @sa #nlVERIFY
+ * @sa #nlASSERT
+ *
+ */
+#define nlABORT(aCondition) __nlABORT(NL_ASSERT_ABORT_NONPRODUCTION_FLAGS, aCondition)
+
+/**
+ * @def nlABORT_ACTION(aCondition, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, and
+ * both executes @p anAction and then invokes #NL_ASSERT_ABORT() if
+ * the condition is false.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_ABORT_NONPRODUCTION_FLAGS
+ * @sa #NL_ASSERT_ABORT_PRODUCTION_FLAGS
+ *
+ * @sa #nlCHECK_ACTION
+ * @sa #nlVERIFY_ACTION
+ * @sa #nlASSERT_ACTION
+ *
+ */
+#define nlABORT_ACTION(aCondition, anAction) __nlABORT_ACTION(NL_ASSERT_ABORT_NONPRODUCTION_FLAGS, aCondition, anAction)
+
+/**
+ * @}
+ *
+ */
+
+#endif /* NLCORE_NLASSERT_NONPRODUCTION_H */
diff --git a/include/nlassert-production.h b/include/nlassert-production.h
new file mode 100644
index 0000000..43ad869
--- /dev/null
+++ b/include/nlassert-production.h
@@ -0,0 +1,713 @@
+/*
+ * Copyright 2010-2016 Nest Labs Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * @file
+ * This file defines macros and interfaces for performing
+ * compile- and run-time assertion checking and run-time
+ * exception handling when #NL_ASSERT_PRODUCTION is true.
+ *
+ */
+
+#ifndef NLASSERT_PRODUCTION_H
+#define NLASSERT_PRODUCTION_H
+
+#include "nlassert-internal.h"
+
+// nlCHECK
+
+/**
+ * @implements nlCHECK(aCondition)
+ *
+ */
+#define nlCHECK(aCondition) __nlASSERT_UNUSED(aCondition)
+
+/**
+ * @implements nlCHECK_ACTION(aCondition, anAction)
+ *
+ */
+#define nlCHECK_ACTION(aCondition, anAction) __nlASSERT_UNUSED(aCondition)
+
+/**
+ * @implements nlCHECK_PRINT(aCondition, aMessage)
+ *
+ */
+#define nlCHECK_PRINT(aCondition, aMessage) __nlASSERT_UNUSED(aCondition)
+
+/**
+ * @implements nlCHECK_SUCCESS(aStatus)
+ *
+ */
+#define nlCHECK_SUCCESS(aStatus) __nlASSERT_UNUSED(aStatus)
+
+/**
+ * @implements nlCHECK_SUCCESS_ACTION(aStatus, anAction)
+ *
+ */
+#define nlCHECK_SUCCESS_ACTION(aStatus, anAction) __nlASSERT_UNUSED(aStatus)
+
+/**
+ * @implements nlCHECK_SUCCESS_PRINT(aStatus, aMessage)
+ *
+ */
+#define nlCHECK_SUCCESS_PRINT(aStatus, aMessage) __nlASSERT_UNUSED(aStatus)
+
+/**
+ * @implements nlNCHECK(aCondition)
+ *
+ */
+#define nlNCHECK(aCondition) __nlASSERT_UNUSED(aCondition)
+
+/**
+ * @implements nlNCHECK_ACTION(aCondition, anAction)
+ *
+ */
+#define nlNCHECK_ACTION(aCondition, anAction) __nlASSERT_UNUSED(aCondition)
+
+/**
+ * @implements nlNCHECK_PRINT(aCondition, aMessage)
+ *
+ */
+#define nlNCHECK_PRINT(aCondition, aMessage) __nlASSERT_UNUSED(aCondition)
+
+// nlVERIFY
+
+/**
+ * @def NL_ASSERT_VERIFY_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for verify-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * enabled.
+ *
+ * This may be used to override #NL_ASSERT_VERIFY_PRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_VERIFY_PRODUCTION_FLAGS NL_ASSERT_VERIFY_PRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup verify-style
+ *
+ */
+#define NL_ASSERT_VERIFY_PRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG)
+
+/**
+ * @def NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * enabled that govern the behavior for verify-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_VERIFY_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup verify-style
+ *
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_VERIFY_PRODUCTION_FLAGS NL_ASSERT_VERIFY_PRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_VERIFY_PRODUCTION_FLAGS)
+#define NL_ASSERT_VERIFY_PRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @implements nlVERIFY(aCondition)
+ *
+ */
+#define nlVERIFY(aCondition) __nlVERIFY(NL_ASSERT_VERIFY_PRODUCTION_FLAGS, aCondition)
+
+/**
+ * @implements nlVERIFY_ACTION(aCondition, anAction)
+ *
+ */
+#define nlVERIFY_ACTION(aCondition, anAction) __nlVERIFY_ACTION(NL_ASSERT_VERIFY_PRODUCTION_FLAGS, aCondition, anAction)
+
+/**
+ * @implements nlVERIFY_PRINT(aCondition, aMessage)
+ *
+ */
+#define nlVERIFY_PRINT(aCondition, aMessage) __nlVERIFY_PRINT(NL_ASSERT_VERIFY_PRODUCTION_FLAGS, aCondition, aMessage)
+
+/**
+ * @implements nlVERIFY_SUCCESS(aStatus)
+ *
+ */
+#define nlVERIFY_SUCCESS(aStatus) __nlVERIFY_SUCCESS(NL_ASSERT_VERIFY_PRODUCTION_FLAGS, aStatus)
+
+/**
+ * @implements nlVERIFY_SUCCESS_ACTION(aStatus, anAction)
+ *
+ */
+#define nlVERIFY_SUCCESS_ACTION(aStatus, anAction) __nlVERIFY_SUCCESS_ACTION(NL_ASSERT_VERIFY_PRODUCTION_FLAGS, aStatus, anAction)
+
+/**
+ * @implements nlVERIFY_SUCCESS_PRINT(aStatus, aMessage)
+ *
+ */
+#define nlVERIFY_SUCCESS_PRINT(aStatus, aMessage) __nlVERIFY_SUCCESS_PRINT(NL_ASSERT_VERIFY_PRODUCTION_FLAGS, aStatus, aMessage)
+
+/**
+ * @implements nlNVERIFY(aCondition)
+ *
+ */
+#define nlNVERIFY(aCondition) __nlNVERIFY(NL_ASSERT_VERIFY_PRODUCTION_FLAGS, aCondition)
+
+/**
+ * @implements nlNVERIFY_ACTION(aCondition, anAction)
+ *
+ */
+#define nlNVERIFY_ACTION(aCondition, anAction) __nlNVERIFY_ACTION(NL_ASSERT_VERIFY_PRODUCTION_FLAGS, aCondition, anAction)
+
+/**
+ * @implements nlNVERIFY_PRINT(aCondition, aMessage)
+ *
+ */
+#define nlNVERIFY_PRINT(aCondition, aMessage) __nlNVERIFY_PRINT(NL_ASSERT_VERIFY_PRODUCTION_FLAGS, aCondition, aMessage)
+
+// nlDESIRE
+
+/**
+ * @def NL_ASSERT_DESIRE_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for desire-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * enabled.
+ *
+ * This may be used to override #NL_ASSERT_DESIRE_PRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_DESIRE_PRODUCTION_FLAGS NL_ASSERT_DESIRE_PRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup desire-style
+ *
+ */
+#define NL_ASSERT_DESIRE_PRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_NONE)
+
+/**
+ * @def NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * enabled that govern the behavior for desire-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_DESIRE_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup desire-style
+ *
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_DESIRE_PRODUCTION_FLAGS NL_ASSERT_DESIRE_PRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_DESIRE_PRODUCTION_FLAGS)
+#define NL_ASSERT_DESIRE_PRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @implements nlDESIRE(aCondition, aLabel)
+ *
+ */
+#define nlDESIRE(aCondition, aLabel) __nlEXPECT(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aCondition, aLabel)
+
+/**
+ * @implements nlDESIRE_PRINT(aCondition, aLabel, aMessage)
+ *
+ */
+#define nlDESIRE_PRINT(aCondition, aLabel, aMessage) __nlEXPECT_PRINT(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @implements nlDESIRE_ACTION(aCondition, aLabel, anAction)
+ *
+ */
+#define nlDESIRE_ACTION(aCondition, aLabel, anAction) __nlEXPECT_ACTION(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @implements nlDESIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ */
+#define nlDESIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlEXPECT_ACTION_PRINT(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+/**
+ * @implements nlDESIRE_SUCCESS(aStatus, aLabel)
+ *
+ */
+#define nlDESIRE_SUCCESS(aStatus, aLabel) __nlEXPECT_SUCCESS(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aStatus, aLabel)
+
+/**
+ * @implements nlDESIRE_SUCCESS_PRINT(aStatus, aLabel, aMessage)
+ *
+ */
+#define nlDESIRE_SUCCESS_PRINT(aStatus, aLabel, aMessage) __nlEXPECT_SUCCESS_PRINT(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aStatus, aLabel, aMessage)
+
+/**
+ * @implements nlDESIRE_SUCCESS_ACTION(aStatus, aLabel, anAction)
+ *
+ */
+#define nlDESIRE_SUCCESS_ACTION(aStatus, aLabel, anAction) __nlEXPECT_SUCCESS_ACTION(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aStatus, aLabel, anAction)
+
+/**
+ * @implements nlDESIRE_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage)
+ *
+ */
+#define nlDESIRE_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage) __nlEXPECT_SUCCESS_ACTION_PRINT(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aStatus, aLabel, anAction, aMessage)
+
+/**
+ * @implements nlNDESIRE(aCondition, aLabel)
+ *
+ */
+#define nlNDESIRE(aCondition, aLabel) __nlNEXPECT(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aCondition, aLabel)
+
+/**
+ * @implements nlNDESIRE_PRINT(aCondition, aLabel, aMessage)
+ *
+ */
+#define nlNDESIRE_PRINT(aCondition, aLabel, aMessage) __nlNEXPECT_PRINT(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @implements nlNDESIRE_ACTION(aCondition, aLabel, anAction)
+ *
+ */
+#define nlNDESIRE_ACTION(aCondition, aLabel, anAction) __nlNEXPECT_ACTION(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @implements nlNDESIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ */
+#define nlNDESIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlNEXPECT_ACTION_PRINT(NL_ASSERT_DESIRE_PRODUCTION_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+// nlREQUIRE
+
+/**
+ * @def NL_ASSERT_REQUIRE_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for require-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * enabled.
+ *
+ * This may be used to override #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_REQUIRE_PRODUCTION_FLAGS NL_ASSERT_REQUIRE_PRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup require-style
+ *
+ */
+#define NL_ASSERT_REQUIRE_PRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG)
+
+/**
+ * @def NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * enabled that govern the behavior for require-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup require-style
+ *
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_REQUIRE_PRODUCTION_FLAGS NL_ASSERT_REQUIRE_PRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS)
+#define NL_ASSERT_REQUIRE_PRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @implements nlREQUIRE(aCondition, aLabel)
+ *
+ */
+#define nlREQUIRE(aCondition, aLabel) __nlEXPECT(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aCondition, aLabel)
+
+/**
+ * @implements nlREQUIRE_PRINT(aCondition, aLabel, aMessage)
+ */
+#define nlREQUIRE_PRINT(aCondition, aLabel, aMessage) __nlEXPECT_PRINT(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @implements nlREQUIRE_ACTION(aCondition, aLabel, anAction)
+ *
+ */
+#define nlREQUIRE_ACTION(aCondition, aLabel, anAction) __nlEXPECT_ACTION(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @implements nlREQUIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ */
+#define nlREQUIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlEXPECT_ACTION_PRINT(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+/**
+ * @implements nlREQUIRE_SUCCESS(aStatus, aLabel)
+ *
+ */
+#define nlREQUIRE_SUCCESS(aStatus, aLabel) __nlEXPECT_SUCCESS(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aStatus, aLabel)
+
+/**
+ * @implements nlREQUIRE_SUCCESS_PRINT(aStatus, aLabel, aMessage)
+ *
+ */
+#define nlREQUIRE_SUCCESS_PRINT(aStatus, aLabel, aMessage) __nlEXPECT_SUCCESS_PRINT(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aStatus, aLabel, aMessage)
+
+/**
+ * @implements nlREQUIRE_SUCCESS_ACTION(aStatus, aLabel, anAction)
+ *
+ */
+#define nlREQUIRE_SUCCESS_ACTION(aStatus, aLabel, anAction) __nlEXPECT_SUCCESS_ACTION(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aStatus, aLabel, anAction)
+
+/**
+ * @implements nlREQUIRE_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage)
+ *
+ */
+#define nlREQUIRE_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage) __nlEXPECT_SUCCESS_ACTION_PRINT(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aStatus, aLabel, anAction, aMessage)
+
+/**
+ * @implements nlNREQUIRE(aCondition, aLabel)
+ *
+ */
+#define nlNREQUIRE(aCondition, aLabel) __nlNEXPECT(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aCondition, aLabel)
+
+/**
+ * @implements nlNREQUIRE_PRINT(aCondition, aLabel, aMessage)
+ *
+ */
+#define nlNREQUIRE_PRINT(aCondition, aLabel, aMessage) __nlNEXPECT_PRINT(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @implements nlNREQUIRE_ACTION(aCondition, aLabel, anAction)
+ *
+ */
+#define nlNREQUIRE_ACTION(aCondition, aLabel, anAction) __nlNEXPECT_ACTION(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @implements nlNREQUIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ */
+#define nlNREQUIRE_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlNEXPECT_ACTION_PRINT(NL_ASSERT_REQUIRE_PRODUCTION_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+// nlPRECONDITION
+
+/**
+ * @def NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for precondition-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * enabled.
+ *
+ * This may be used to override #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup precondition-style
+ *
+ */
+#define NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG)
+
+/**
+ * @def NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * disabled that govern the behavior for precondition-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup precondition-style
+ *
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS)
+#define NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @implements nlPRECONDITION(aCondition)
+ *
+ */
+#define nlPRECONDITION(aCondition) __nlPRECONDITION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return)
+
+/**
+ * @implements nlPRECONDITION_ACTION(aCondition, anAction)
+ *
+ */
+#define nlPRECONDITION_ACTION(aCondition, anAction) __nlPRECONDITION_ACTION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return, anAction)
+
+/**
+ * @implements nlPRECONDITION_PRINT(aCondition, aMessage)
+ *
+ */
+#define nlPRECONDITION_PRINT(aCondition, aMessage) __nlPRECONDITION_PRINT(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return, aMessage)
+
+/**
+ * @implements nlPRECONDITION_SUCCESS(aStatus)
+ *
+ */
+#define nlPRECONDITION_SUCCESS(aStatus) __nlPRECONDITION_SUCCESS(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aStatus, return)
+
+/**
+ * @implements nlPRECONDITION_SUCCESS_ACTION(aStatus, anAction)
+ *
+ */
+#define nlPRECONDITION_SUCCESS_ACTION(aStatus, anAction) __nlPRECONDITION_SUCCESS_ACTION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aStatus, return, anAction)
+
+/**
+ * @implements nlPRECONDITION_SUCCESS_PRINT(aStatus, aMessage)
+ *
+ */
+#define nlPRECONDITION_SUCCESS_PRINT(aStatus, aMessage) __nlPRECONDITION_SUCCESS_PRINT(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aStatus, return, aMessage)
+
+/**
+ * @implements nlNPRECONDITION(aCondition)
+ *
+ */
+#define nlNPRECONDITION(aCondition) __nlNPRECONDITION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return)
+
+/**
+ * @implements nlNPRECONDITION_ACTION(aCondition, anAction)
+ *
+ */
+#define nlNPRECONDITION_ACTION(aCondition, anAction) __nlNPRECONDITION_ACTION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return, anAction)
+
+/**
+ * @implements nlNPRECONDITION_PRINT(aCondition, aMessage)
+ *
+ */
+#define nlNPRECONDITION_PRINT(aCondition, aMessage) __nlNPRECONDITION_PRINT(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return, aMessage)
+
+/**
+ * @implements nlPRECONDITION_VALUE(aCondition, aValue)
+ *
+ */
+#define nlPRECONDITION_VALUE(aCondition, aValue) __nlPRECONDITION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return aValue)
+
+/**
+ * @implements nlPRECONDITION_VALUE_ACTION(aCondition, aValue, anAction)
+ *
+ */
+#define nlPRECONDITION_VALUE_ACTION(aCondition, aValue, anAction) __nlPRECONDITION_ACTION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return aValue, anAction)
+
+/**
+ * @implements nlPRECONDITION_VALUE_PRINT(aCondition, aValue, aMessage)
+ *
+ */
+#define nlPRECONDITION_VALUE_PRINT(aCondition, aValue, aMessage) __nlPRECONDITION_PRINT(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return aValue, aMessage)
+
+/**
+ * @implements nlPRECONDITION_VALUE_SUCCESS(aStatus, aValue)
+ *
+ */
+#define nlPRECONDITION_VALUE_SUCCESS(aStatus, aValue) __nlPRECONDITION_SUCCESS(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aStatus, return aValue)
+
+/**
+ * @implements nlPRECONDITION_VALUE_SUCCESS_ACTION(aStatus, aValue, anAction)
+ *
+ */
+#define nlPRECONDITION_VALUE_SUCCESS_ACTION(aStatus, aValue, anAction) __nlPRECONDITION_SUCCESS_ACTION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aStatus, return aValue, anAction)
+
+/**
+ * @implements nlPRECONDITION_VALUE_SUCCESS_PRINT(aStatus, aValue, aMessage)
+ *
+ */
+#define nlPRECONDITION_VALUE_SUCCESS_PRINT(aStatus, aValue, aMessage) __nlPRECONDITION_SUCCESS_PRINT(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aStatus, return aValue, aMessage)
+
+/**
+ * @implements nlNPRECONDITION_VALUE(aCondition, aValue)
+ *
+ */
+#define nlNPRECONDITION_VALUE(aCondition, aValue) __nlNPRECONDITION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return aValue)
+
+/**
+ * @implements nlNPRECONDITION_VALUE_ACTION(aCondition, aValue, anAction)
+ *
+ */
+#define nlNPRECONDITION_VALUE_ACTION(aCondition, aValue, anAction) __nlNPRECONDITION_ACTION(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return aValue, anAction)
+
+/**
+ * @implements nlNPRECONDITION_VALUE_PRINT(aCondition, aValue, aMessage)
+ *
+ */
+#define nlNPRECONDITION_VALUE_PRINT(aCondition, aValue, aMessage) __nlNPRECONDITION_PRINT(NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS, aCondition, return aValue, aMessage)
+
+// nlASSERT
+
+/**
+ * @implements nlASSERT(aCondition)
+ *
+ */
+#define nlASSERT(aCondition) __nlASSERT_UNUSED(aCondition)
+
+/**
+ * @implements nlASSERT_ACTION(aCondition, anAction)
+ *
+ */
+#define nlASSERT_ACTION(aCondition, anAction) __nlASSERT_UNUSED(aCondition)
+
+// nlABORT
+
+/**
+ * @def NL_ASSERT_ABORT_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for abort-style
+ * exception family assertions when #NL_ASSERT_PRODUCTION is
+ * enabled.
+ *
+ * This may be used to override #NL_ASSERT_ABORT_PRODUCTION_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_ABORT_PRODUCTION_FLAGS NL_ASSERT_ABORT_PRODUCTION_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_ABORT_PRODUCTION_FLAGS
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup abort-style
+ *
+ */
+#define NL_ASSERT_ABORT_PRODUCTION_FLAGS_DEFAULT (NL_ASSERT_FLAG_BACKTRACE | NL_ASSERT_FLAG_LOG)
+
+/**
+ * @def NL_ASSERT_ABORT_PRODUCTION_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags when #NL_ASSERT_PRODUCTION is
+ * enabled that govern the behavior for abort-style exception
+ * family assertions when the assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_ABORT_PRODUCTION_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_PRODUCTION
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @ingroup abort-style
+ *
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_ABORT_PRODUCTION_FLAGS NL_ASSERT_ABORT_PRODUCTION_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_ABORT_PRODUCTION_FLAGS)
+#define NL_ASSERT_ABORT_PRODUCTION_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @implements nlABORT(aCondition)
+ *
+ */
+#define nlABORT(aCondition) __nlABORT(NL_ASSERT_ABORT_PRODUCTION_FLAGS, aCondition)
+
+/**
+ * @implements nlABORT_ACTION(aCondition, anAction)
+ *
+ */
+#define nlABORT_ACTION(aCondition, anAction) __nlABORT_ACTION(NL_ASSERT_ABORT_PRODUCTION_FLAGS, aCondition, anAction)
+
+#endif /* NLASSERT_PRODUCTION_H */
diff --git a/include/nlassert.h b/include/nlassert.h
new file mode 100644
index 0000000..8ba0d1f
--- /dev/null
+++ b/include/nlassert.h
@@ -0,0 +1,1728 @@
+/*
+ * Copyright 2010-2016 Nest Labs Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * @file
+ * This file defines macros and interfaces for performing both
+ * compile- and run-time assertion checking and run-time
+ * exception handling.
+ *
+ * Where exception-handing is concerned, the format of the macros
+ * are inspired by those found in Mac OS Classic and, later, Mac
+ * OS X. These, in turn, were inspired by "Living In an
+ * Exceptional World" by Sean Parent (develop, The Apple
+ * Technical Journal, Issue 11, August/September 1992)
+ * <http://www.mactech.com/articles/develop/issue_11/Parent_final.html>
+ * for the methodology behind these error handling and assertion
+ * macros.
+ *
+ */
+
+/**
+ * @mainpage notitle
+ *
+ * @section introduction Introduction
+ *
+ * This package defines macros and interfaces for performing both
+ * compile- and run-time assertion checking and run-time exception
+ * handling.
+ *
+ * Where exception-handing is concerned, the format of the macros are
+ * inspired by those found in Mac OS Classic and, later, Mac OS
+ * X. These, in turn, were inspired by "Living In an Exceptional
+ * World" by Sean Parent (develop, The Apple Technical Journal, Issue
+ * 11, August/September 1992). See:
+ *
+ * http://www.mactech.com/articles/develop/issue_11/Parent_final.html
+ *
+ * for the methodology behind these error handling and assertion
+ * macros.
+ *
+ * @section overview Overview
+ *
+ * The interfaces in this package come in two interface modalities:
+ *
+ * <dl>
+ * <dt>[Run-time](@ref run-time)</dt>
+ * <dd>Interfaces that dynamically check a logical assertion and
+ * alter run-time execution on assertion firing.</dd>
+ * <dt>[Compile-time](@ref compile-time)</dt>
+ * <dd>Interfaces that statically check a logical assertion and
+ * terminate compile-time execution on assertion firing.</dd>
+ * </dl>
+ *
+ * @subsection run-time Run-time
+ *
+ * The [run-time modality interfaces](@ref run-time-interfaces) in
+ * this package come in three families:
+ *
+ * <dl>
+ * <dt>[Assertion](@ref run-time-assertions)</dt>
+ * <dd>Similar to the traditional C Standard Library
+ * [assert()](http://pubs.opengroup.org/onlinepubs/009695399/functions/assert.html).</dd>
+ *
+ * <dt>[Precondition](@ref preconditions)</dt>
+ * <dd>Designed to be placed at the head of an interface or
+ * method to check incoming parameters and return on
+ * assertion failure.</dd>
+ *
+ * <dt>[Exception](@ref exceptions)</dt>
+ * <dd>Designed to jump to a local label on assertion failure
+ * to support the method of error and exception handling that
+ * advocates a single function or method return site and, by
+ * extension, consolidated points of exception and error
+ * handling as well as resource clean-up.</dd>
+ * </dl>
+ *
+ * There are several styles of interfaces within each family and
+ * several potential variants within each style, all of which are
+ * summarized below and are described in detail in the following
+ * sections.
+ *
+ * @subsection compile-time Compile-time
+ *
+ * The [compile-time modality interfaces](@ref compile-time-interfaces)
+ * in this package are simpler and come in a single family with a
+ * couple of variants.
+ *
+ * @section run-time-interfaces Run-time Interfaces
+ *
+ * @subsection triggers Behavior Triggers
+ *
+ * Unlike the traditional C Standard Library
+ * [assert()](http://pubs.opengroup.org/onlinepubs/009695399/functions/assert.html)
+ * or other assertion checking packages, this package offers the
+ * ability to enable and customize one or more of a few triggers that
+ * run when an assertion fires, including:
+ *
+ * * [Abort](@ref abort-behavior)
+ * * [Backtrace](@ref backtrace-behavior)
+ * * [Log](@ref log-behavior)
+ * * [Trap](@ref trap-behavior)
+ *
+ * @subsubsection abort-behavior Abort
+ *
+ * The abort behavior trigger allows, on an assertion firing, to
+ * execute a trigger that terminates overall program or system
+ * execution.
+ *
+ * Note, however, the abort behavior trigger is only available in
+ * some styles of the [assertion-family](@ref run-time-assertions) of
+ * interfaces.
+ *
+ * Please see #NL_ASSERT_ABORT() and @ref customization for more
+ * information about this behavior trigger.
+ *
+ * @subsubsection backtrace-behavior Backtrace
+ *
+ * The backtrace behavior trigger allows, on an assertion firing, to
+ * execute a trigger that generates a stack backtrace.
+ *
+ * This style of assertion is available, when configured, on all
+ * interface families.
+ *
+ * Please see #NL_ASSERT_BACKTRACE() and @ref customization for more
+ * information about this behavior trigger.
+ *
+ * @subsubsection log-behavior Log
+ *
+ * The log behavior trigger allows, on an assertion firing, to
+ * execute a trigger that logs a message summarizing the assertion
+ * that fired.
+ *
+ * This style of assertion is available, when configured, on all
+ * interface families.
+ *
+ * Please see #NL_ASSERT_LOG() and @ref customization for more
+ * information about this behavior trigger.
+ *
+ * @subsubsection trap-behavior Trap
+ *
+ * The log behavior trigger allows, on an assertion firing, to
+ * execute a trigger that generates a debugger trap or exception.
+ *
+ * This style of assertion is available, when configured, on all
+ * interface families.
+ *
+ * Please see #NL_ASSERT_TRAP() and @ref customization for more
+ * information about this behavior trigger.
+ *
+ * @subsection run-time-assertions Assertion Interfaces
+ *
+ * The assertion interfaces are similar to the traditional C
+ * Standard Library
+ * [assert()](http://pubs.opengroup.org/onlinepubs/009695399/functions/assert.html).
+ *
+ * These interfaces include the following styles:
+ *
+ * * [Assert](@ref run-time-assert)
+ * * [Abort](@ref run-time-abort)
+ * * [Check](@ref run-time-check)
+ * * [Verify](@ref run-time-verify)
+ *
+ * The following table summarizes the relationship and features among
+ * the styles:
+
+ * <table>
+ * <tr>
+ * <th rowspan="2">Style</th>
+ * <th colspan="4">Behaviors</th>
+ * <th colspan="2">Availability</th>
+ * </tr>
+ * <tr>
+ * <th>Abort</th>
+ * <th>Backtrace</th>
+ * <th>Log</th>
+ * <th>Trap</th>
+ * <th>Non-production</th>
+ * <th>Production</th>
+ * </tr>
+ * <tr>
+ * <td>Assert</td>
+ * <td align="center">Non-production</td>
+ * <td align="center">Non-production</td>
+ * <td align="center">Non-production</td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center"></td>
+ * </tr>
+ * <tr>
+ * <td>Abort</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>Check</td>
+ * <td align="center"></td>
+ * <td align="center">Non-production</td>
+ * <td align="center">Non-production</td>
+ * <td align="center">Non-production</td>
+ * <td align="center">X</td>
+ * <td align="center"></td>
+ * </tr>
+ * <tr>
+ * <td>Verify</td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">Non-production</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * </table>
+ *
+ * @note The above described behaviors are only in effect when
+ * #NL_ASSERT_USE_FLAGS_DEFAULT to 1. See @ref customization
+ * for more information on configuring and customizing the
+ * trigger behaviors.
+ *
+ * @subsubsection run-time-assert Assert
+ *
+ * These assertions are identical to the traditional C Standard
+ * Library-style assertion (see
+ * [assert()](http://pubs.opengroup.org/onlinepubs/009695399/functions/assert.html))
+ * except that side-effects, if any, in the asserted expression will be
+ * produced even when the assertion is made inactive, as in production build
+ * configurations, by setting #NL_ASSERT_PRODUCTION to true.
+ *
+ * Like the C Standard Library assertion, a trigger of this style of
+ * assertion interface will invoke #NL_ASSERT_ABORT().
+ *
+ * @subsubsection run-time-abort Abort
+ *
+ * These assertions are identical to the @ref run-time-assert style
+ * assertions; however, they are active in __both__ non-production
+ * __and__ production build configurations.
+ *
+ * A trigger of this style of assertion interface will invoke #NL_ASSERT_ABORT().
+ *
+ * @subsubsection run-time-check Check
+ *
+ * These assertions are similar to the @ref run-time-assert style; however,
+ * this style __does not__ abort. Normal program flow and execution
+ * will continue past this assertion.
+ *
+ * Side-effects, if any, in the asserted expression will be produced even when
+ * the assertion is made inactive, as in production build configurations, by
+ * setting #NL_ASSERT_PRODUCTION to true.
+ *
+ * @subsubsection run-time-verify Verify
+ *
+ * These assertions are similar to the @ref run-time-abort style; however,
+ * this style __does not__ abort. Normal program flow and execution
+ * will continue past this assertion.
+ *
+ * These are active in __both__ non-production __and__ production
+ * build configurations.
+ *
+ * @subsection preconditions Precondition Interfaces
+ *
+ * These assertions are designed to be placed at the head of an
+ * interface or method to check incoming parameters.
+ *
+ * These assertions implicitly return, either void or a specified
+ * value for non-void interfaces or methods.
+ *
+ * @note This family of interfaces may be in violation of your site's
+ * or project's coding style and best practices by virtue of its
+ * implicit return. If so, please consider using the
+ * [exception-style](@ref exceptions) interfaces instead.
+ *
+ * The following table summarizes the features for this family of interfaces:
+ *
+ * <table>
+ * <tr>
+ * <th rowspan="2">Style</th>
+ * <th colspan="4">Behaviors</th>
+ * <th colspan="2">Availability</th>
+ * </tr>
+ * <tr>
+ * <th>Abort</th>
+ * <th>Backtrace</th>
+ * <th>Log</th>
+ * <th>Trap</th>
+ * <th>Non-production</th>
+ * <th>Production</th>
+ * </tr>
+ * <tr>
+ * <td>Precondition</td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * </table>
+ *
+ * @note The above described behaviors are only in effect when
+ * #NL_ASSERT_USE_FLAGS_DEFAULT to 1. See @ref customization
+ * for more information on configuring and customizing the
+ * trigger behaviors.
+ *
+ * @subsection exceptions Exception Interfaces
+ *
+ * This family of interfaces is designed to support the method of
+ * error and exception handling that advocates a single function or
+ * method return site and, by extension, consolidated points of
+ * exception and error handling as well as resource clean-up.
+ *
+ * A general example usage of this family of interfaces is:
+ *
+ * @code
+ * int Bar(uint8_t **aBuffer, const Foo *aParameter)
+ * {
+ * const size_t size = 1024;
+ * int retval = 0;
+ *
+ * nlREQUIRE(aBuffer != NULL, exit, retval = -EINVAL);
+ *
+ * *aBuffer = (uint8_t *)malloc(size);
+ * nlREQUIRE(*aBuffer != NULL, exit, retval = -ENOMEM);
+ *
+ * memset(*aBuffer, 0, size);
+ *
+ * exit:
+ * return retval;
+ * }
+ * @endcode
+ *
+ * As shown in the example, this family checks for the specified
+ * condition, which is expected to commonly be true, and branches to
+ * the specified label if the condition is false.
+ *
+ * * [Expect](@ref expect)
+ * * [Desire](@ref desire)
+ * * [Require](@ref require)
+ *
+ * This family of interfaces are all identical across the styles and
+ * all styles support an identical set of variants. The only
+ * difference among them is the default configured trigger action
+ * behavior, as summarized in the table below:
+ *
+ * <table>
+ * <tr>
+ * <th rowspan="2">Style</th>
+ * <th colspan="3">Behaviors</th>
+ * <th colspan="2">Availability</th>
+ * </tr>
+ * <tr>
+ * <th>Backtrace</th>
+ * <th>Log</th>
+ * <th>Trap</th>
+ * <th>Non-production</th>
+ * <th>Production</th>
+ * </tr>
+ * <tr>
+ * <td>Expect</td>
+ * <td></td>
+ * <td></td>
+ * <td></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>Desire</td>
+ * <td></td>
+ * <td align="center">Non-production</td>
+ * <td></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>Require</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">Non-production</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * </table>
+ *
+ * @note The above described behaviors are only in effect when
+ * #NL_ASSERT_USE_FLAGS_DEFAULT to 1. See @ref customization
+ * for more information on configuring and customizing the
+ * trigger behaviors.
+ *
+ * @subsubsection expect Expect
+ *
+ * These assertions are designed to be placed anywhere an exceptional
+ * condition might occur where handling needs to locally jump to
+ * error-handling code.
+ *
+ * These checks are always present and do nothing beyond branching to
+ * the named exception label. Consequently, they are simply mnemonics
+ * or syntactic sugar.
+ *
+ * This style of check should be used where either true or false
+ * evaluation of the assertion expression are equally likely since
+ * there is no default configured trigger behavior.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @subsubsection desire Desire
+ *
+ * These are identical to the @ref expect style checks; except for
+ * their non-production and production configured behavior.
+ *
+ * This style of check should be used where false evaluation of the
+ * assertion expression is expected to be occasional.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Occasional
+ *
+ * @subsubsection require Require
+ *
+ * These are identical to the @ref expect style checks; except for
+ * their non-production and production configured behavior.
+ *
+ * This style of check should be used where false evaluation of the
+ * assertion expression is expected to be rare.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Rare
+ *
+ * @subsection variants Variants
+ *
+ * The three families of run-time interface are available in one of several
+ * variants, as summarized below. <em><STYLE></em> may be replaced with one of (see [Run-time Availability](@ref run-time-availability) for details):
+ *
+ * * ASSERT
+ * * ABORT
+ * * CHECK
+ * * VERIFY
+ * * PRECONDITION
+ * * EXPECT
+ * * DESIRE
+ * * REQUIRE
+ *
+ * to form an actual interface name.
+ *
+ * | Interface Variant | Description |
+ * |:---------------------------------------------- |:------------------------------------------------------------------------------------------------------------ |
+ * | nl<em><STYLE></em> | Base variant; execute the check. |
+ * | nl<em><STYLE></em>\_ACTION | Execute the base check and execute the action if the check fails. |
+ * | nl<em><STYLE></em>\_PRINT | Execute the base check and print the descriptive string if the check fails. |
+ * | nl<em><STYLE></em>\_ACTION_PRINT | Execute the base check and both execute the action and print the descriptive string if the check fails. |
+ * | nl<em><STYLE></em>\_SUCCESS | Adds a check against zero (0) as the logical condition to assert. |
+ * | nl<em><STYLE></em>\_SUCCESS_ACTION | Execute the success check and execute the action if the check fails. |
+ * | nl<em><STYLE></em>\_SUCCESS_PRINT | Execute the success check and print the descriptive string if the check fails. |
+ * | nl<em><STYLE></em>\_SUCCESS_ACTION_PRINT | Execute the success check and both execute the action and print the descriptive string if the check fails. |
+ * | nlN<em><STYLE></em> | Inverts the logical sense of the base check; execute the check. |
+ * | nlN<em><STYLE></em>\_ACTION | Execute the inversion check and execute the action if the check fails. |
+ * | nlN<em><STYLE></em>\_PRINT | Execute the inversion check and print the descriptive string if the check fails. |
+ * | nlN<em><STYLE></em>\_ACTION_PRINT | Execute the inversion check and both execute the action and print the descriptive string if the check fails. |
+ *
+ * @section run-time-availability Run-time Availability
+ *
+ * The following table indicates the availability of the run-time interface
+ * variants for each style.
+ *
+ * <table>
+ * <tr>
+ * <th rowspan="2">Interface Variant</th>
+ * <th colspan="8">Style</th>
+ * </tr>
+ * <tr>
+ * <th>Assert</th>
+ * <th>Abort</th>
+ * <th>Check</th>
+ * <th>Verify</th>
+ * <th>Precondition</th>
+ * <th>Expect</th>
+ * <th>Desire</th>
+ * <th>Require</th>
+ * </tr>
+ * <tr>
+ * <td>nl<em><STYLE></em></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nl<em><STYLE></em>\_ACTION</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nl<em><STYLE></em>\_PRINT</td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nl<em><STYLE></em>\_ACTION_PRINT</td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nl<em><STYLE></em>\_SUCCESS</td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nl<em><STYLE></em>\_SUCCESS_ACTION</td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nl<em><STYLE></em>\_SUCCESS_PRINT</td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nl<em><STYLE></em>\_SUCCESS_ACTION_PRINT</td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nlN<em><STYLE></em></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nlN<em><STYLE></em>\_ACTION</td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nlN<em><STYLE></em>\_PRINT</td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nlN<em><STYLE></em>\_ACTION_PRINT</td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center"></td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * </table>
+ *
+ * @section customization Customization
+ *
+ * The Nest Labs Assertion library is designed "out of the box" to
+ * provide a high degree of utility. However, there are a number of
+ * aspects that can be tuned on a per-module, -project, or -site basis
+ * to customize the appearance and behavior through user-definable
+ * attributes via the C preprocessor.
+ *
+ * @subsection userattrs User-definable Attributes
+ *
+ * The following attributes may be defined by the user before
+ * the nlassert.h header is included by the preprocessor, overriding
+ * the default behavior:
+ *
+ * * #NL_ASSERT_PRODUCTION
+ * * #NL_ASSERT_PREFIX_STRING
+ * * #NL_ASSERT_COMPONENT_STRING
+ * * #NL_ASSERT_FILE
+ * * #NL_ASSERT_ABORT
+ * * #NL_ASSERT_BACKTRACE
+ * * #NL_ASSERT_LOG
+ * * #NL_ASSERT_TRAP
+ *
+ * Without any customization, all of the interface styles are set to
+ * use __no__ trigger behaviors (i.e. #NL_ASSERT_FLAG_NONE). However, a
+ * set of default trigger behaviors (as documented in the tables
+ * above) may be enabled by setting #NL_ASSERT_USE_FLAGS_DEFAULT to 1
+ * before nlassert.h is included by the preprocessor.
+ *
+ * Otherwise, the following attributes may be overridden, customizing
+ * the trigger behavior of each assertion interface family for both
+ * non-production and production configurations:
+ *
+ * * #NL_ASSERT_EXPECT_FLAGS
+ *
+ * * #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS
+ * * #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS
+ * * #NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS
+ * * #NL_ASSERT_ABORT_NONPRODUCTION_FLAGS
+ * * #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS
+ * * #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS
+ * * #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS
+ *
+ * * #NL_ASSERT_VERIFY_PRODUCTION_FLAGS
+ * * #NL_ASSERT_ABORT_PRODUCTION_FLAGS
+ * * #NL_ASSERT_DESIRE_PRODUCTION_FLAGS
+ * * #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS
+ * * #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS
+ *
+ * @section compile-time-interfaces Compile-time Interfaces
+ *
+ * The compile-time interfaces are a limited subset of their run-time
+ * counterparts. Rather than altering run-time execution on assertion
+ * firing against a dynamically-checked run-time condition, these
+ * interfaces terminate compilation against a statically-checked
+ * compile-time condition.
+ *
+ * @subsection compile-time-assertions Assertion Interfaces
+ *
+ * These interfaces have only one style:
+ *
+ * * [Assert](@ref compile-time-assert)
+ *
+ * <table>
+ * <tr>
+ * <th rowspan="2">Style</th>
+ * <th colspan="2">Availability</th>
+ * </tr>
+ * <tr>
+ * <th>Non-production</th>
+ * <th>Production</th>
+ * </tr>
+ * <tr>
+ * <td>Assert</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * </table>
+ *
+ * @subsubsection compile-time-assert Assert
+ *
+ * These assertions are active in __both__ non-production
+ * __and__ production build configurations. This behavior
+ * is unconventional with respect to the [run-time assert-style assertions](@ref run-time-assert)
+ * but very conventional with respect to the similar
+ * C11/C++11 static-assertion standards.
+ *
+ * @subsection compile-time-variants Variants
+ *
+ * The compile-time interfaces are available in two variants:
+ *
+ * | Interface Variant | Description |
+ * |:---------------------------------------------- |:------------------------------------------------------------------------------------------------------------ |
+ * | nlSTATIC\_ASSERT | Base variant; execute the check. |
+ * | nlSTATIC\_ASSERT\_PRINT | Execute the base check with a descriptive string. Note, this string is not actually emitted in any meaningful way. It serves to simply comment or annotate the assertion and to provide interface parallelism with the run-time assertion interfaces. |
+ *
+ * @section compile-time-availability Compile-time Availability
+ *
+ * The following table indicates the availability of the compile-time interface
+ * variants.
+ *
+ * <table>
+ * <tr>
+ * <th rowspan="2">Interface Variant</th>
+ * <th colspan="2">Availability</th>
+ * </tr>
+ * <tr>
+ * <th>Non-Production</th>
+ * <th>Production</th>
+ * </tr>
+ * <tr>
+ * <td>nlSTATIC\_ASSERT</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * <tr>
+ * <td>nlSTATIC\_ASSERT\_PRINT</td>
+ * <td align="center">X</td>
+ * <td align="center">X</td>
+ * </tr>
+ * </table>
+ *
+ * @section compatibility Standard C Library Compatibility
+ *
+ * This package also provides an ISO/IEC 9899:1999-, C89-, and
+ * C99-compatible Standard C Library header (via assert.h) and
+ * assertion interface definition (assert()), implemented atop Nest
+ * Labs assertion checking and runtime exception interfaces such that
+ * consistent platform and system capabilities, behavior, and output
+ * may be implemented and enforced across the two interfaces.
+ *
+ * Systems wishing to use this compatibility header and interface in
+ * lieu of their Standard C Library header of the same name should
+ * ensure that their toolchain is configured to either ignore or
+ * deprioritize standard search paths while placing the directory this
+ * header is contained in among the preferred header search paths.
+ *
+ */
+
+#ifndef NLCORE_NLASSERT_H
+#define NLCORE_NLASSERT_H
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+/**
+ * @name Behavioral Control Flags
+ *
+ * @brief
+ * These flags are used to influence the behavior of the various
+ * classes and styles of assertion macros.
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_FLAG_NONE
+ *
+ * @brief
+ * Perform no actions when an assertion expression evaluates to
+ * false.
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#define NL_ASSERT_FLAG_NONE 0x00000000
+
+/**
+ * @def NL_ASSERT_FLAG_BACKTRACE
+ *
+ * @brief
+ * Invoke #NL_ASSERT_BACKTRACE() when an assertion expression
+ * evaluates to false.
+ *
+ * @note For the *_ACTION*-style assertion variants,
+ * #NL_ASSERT_BACKTRACE() is a pre-action trigger and will run
+ * before the specified action.
+ *
+ * @sa #NL_ASSERT_FLAG_NONE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @sa #NL_ASSERT_BACKTRACE
+ *
+ */
+#define NL_ASSERT_FLAG_BACKTRACE 0x00000001
+
+/**
+ * @def NL_ASSERT_FLAG_LOG
+ *
+ * @brief
+ * Invoke #NL_ASSERT_LOG() when an assertion expression evaluates
+ * to false.
+ *
+ * @note For the *_ACTION*-style assertion variants,
+ * #NL_ASSERT_LOG() is a pre-action trigger and will run
+ * before the specified action.
+ *
+ * @sa #NL_ASSERT_FLAG_NONE
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ * @sa #NL_ASSERT_LOG
+ *
+ */
+#define NL_ASSERT_FLAG_LOG 0x00000002
+
+/**
+ * @def NL_ASSERT_FLAG_TRAP
+ *
+ * @brief
+ * Invoke #NL_ASSERT_TRAP() when an assertion expression evaluates
+ * to false.
+ *
+ * @note For the *_ACTION*-style assertion variants,
+ * #NL_ASSERT_TRAP() is a post-action trigger and will run
+ * after the specified action.
+ *
+ * @sa #NL_ASSERT_FLAG_NONE
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ *
+ * @sa #NL_ASSERT_TRAP
+ *
+ */
+#define NL_ASSERT_FLAG_TRAP 0x00000004
+
+/**
+ * @}
+ *
+ */
+
+/**
+ * @def NL_ASSERT_USE_FLAGS_DEFAULT
+ *
+ * @brief
+ * Enable (1) or disable (0) use of the default trigger behavior flags.
+ *
+ * This enables or disables the use of the default trigger behavior
+ * flags as specified by:
+ *
+ * * #NL_ASSERT_EXPECT_FLAGS_DEFAULT
+ *
+ * * #NL_ASSERT_CHECK_NONPRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_VERIFY_NONPRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_ASSERT_NONPRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_ABORT_NONPRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_DESIRE_NONPRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_REQUIRE_NONPRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_PRECONDITION_NONPRODUCTION_FLAGS_DEFAULT
+ *
+ * * #NL_ASSERT_VERIFY_PRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_ABORT_PRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_DESIRE_PRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_REQUIRE_PRODUCTION_FLAGS_DEFAULT
+ * * #NL_ASSERT_PRECONDITION_PRODUCTION_FLAGS_DEFAULT
+ *
+ * Setting this to 1, effectively does the following:
+ *
+ * @code
+ * #define NL_ASSERT_<STYLE>_<CONFIGURATION>_FLAGS NL_ASSERT_<STYLE>_<CONFIGURATION>_FLAGS_DEFAULT
+ * @endcode
+ *
+ * for each assertion interface <em><STYLE></em> for both
+ * non-production and production (see #NL_ASSERT_PRODUCTION) <em><CONFIGURATION></em> .
+ *
+ */
+#if !defined(NL_ASSERT_USE_FLAGS_DEFAULT)
+#define NL_ASSERT_USE_FLAGS_DEFAULT 0
+#endif /* !defined(NL_ASSERT_USE_FLAGS_DEFAULT) */
+
+/**
+ * @def NL_ASSERT_PRODUCTION
+ *
+ * @brief
+ * Enable (1) or disable (0) when production (or non-production)
+ * assertion behavior is desired.
+ *
+ * When production behavior is asserted, a number of interface
+ * families are elided entirely and for others, the default behavior
+ * changes (default: ((defined(NDEBUG) && NDEBUG) || (defined(DEBUG)
+ * && !DEBUG) || 1)).
+ *
+ */
+#if !defined(NL_ASSERT_PRODUCTION)
+#if defined(NDEBUG)
+#define NL_ASSERT_PRODUCTION NDEBUG
+#elif defined(DEBUG)
+#define NL_ASSERT_PRODUCTION !DEBUG
+#else
+#define NL_ASSERT_PRODUCTION 1
+#endif /* defined(NDEBUG) */
+#endif /* !defined(NL_ASSERT_PRODUCTION) */
+
+/**
+ * @name Log Output Definitions
+ *
+ * @brief
+ * These definitions control how the output of assertion log
+ * messages appear, when so configured, on assertion expression
+ * failure evaluation.
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_PREFIX_STRING
+ *
+ * @brief
+ * This is the string printed at the beginning of the assertion
+ * printed (default: 'ASSERT: ').
+ *
+ * Developers may, but are generally not encouraged to, override
+ * this by defining #NL_ASSERT_PREFIX_STRING before nlassert.h is
+ * included by the preprocessor, as shown in the following example:
+ *
+ * @code
+ * #define NL_ASSERT_PREFIX_STRING "assertion: "
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_PREFIX_STRING
+ */
+#if !defined(NL_ASSERT_PREFIX_STRING)
+#define NL_ASSERT_PREFIX_STRING "ASSERT: "
+#endif /* !defined(NL_ASSERT_PREFIX_STRING) */
+
+/**
+ * @def NL_ASSERT_COMPONENT_STRING
+ *
+ * @brief
+ * This is the string printed following the prefix string (see
+ * #NL_ASSERT_PREFIX_STRING) that indicates what module, program,
+ * application or subsystem the assertion occurred in (default:
+ * '').
+ *
+ * Developers may override this by defining
+ * #NL_ASSERT_COMPONENT_STRING before nlassert.h is included by the
+ * preprocessor, as shown in the following example:
+ *
+ * @code
+ * #define NL_ASSERT_COMPONENT_STRING "nlbar"
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_PREFIX_STRING
+ *
+ */
+#if !defined(NL_ASSERT_COMPONENT_STRING)
+#define NL_ASSERT_COMPONENT_STRING ""
+#endif /* !defined(NL_ASSERT_COMPONENT_STRING) */
+
+/**
+ * @}
+ *
+ */
+
+/**
+ * @def NL_ASSERT_ABORT()
+ *
+ * @brief
+ * This macro is invoked when an nlASSERT- or nlABORT-style
+ * assertion expression evaluates to false.
+ *
+ * By default, this is defined to the C Standard Library
+ * [abort()](http://pubs.opengroup.org/onlinepubs/009695399/functions/abort.html). When
+ * overridden, this should generally provide similar functionality,
+ * terminating the overall process or system execution.
+ *
+ * Developers may override and customize this by defining
+ * #NL_ASSERT_ABORT() before nlassert.h is included by the
+ * preprocessor.
+ *
+ */
+#if !defined(NL_ASSERT_ABORT)
+#define NL_ASSERT_ABORT() abort()
+#endif /* !defined(NL_ASSERT_ABORT) */
+
+/**
+ * @def NL_ASSERT_BACKTRACE()
+ *
+ * @brief
+ * This macro is invoked when an assertion expression evaluates to
+ * false when the macro has been configured with / passed
+ * #NL_ASSERT_FLAG_BACKTRACE.
+ *
+ * By default, this is defined to do nothing. However, when defined,
+ * this should generally generate a stack back trace when invoked.
+ *
+ * Developers may override and customize this by defining
+ * #NL_ASSERT_BACKTRACE() before nlassert.h is included by the
+ * preprocessor.
+ *
+ * @note For the *_ACTION*-style assertion variants,
+ * #NL_ASSERT_BACKTRACE() is a pre-action trigger and will run
+ * before the specified action.
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ *
+ */
+#if !defined(NL_ASSERT_BACKTRACE)
+#define NL_ASSERT_BACKTRACE()
+#endif /* !defined(NL_ASSERT_BACKTRACE) */
+
+/**
+ * @def NL_ASSERT_TRAP()
+ *
+ * @brief
+ * This macro is invoked when an assertion expression evaluates to
+ * false when the macro has been configured with / passed
+ * #NL_ASSERT_FLAG_TRAP.
+ *
+ * By default, this is defined to do nothing. However, when defined,
+ * this should generally generate a debug trap or breakpoint such that
+ * when the assertion expression evaluates to false an attached
+ * debugger will stop at the assertion point.
+ *
+ * Developers may override and customize this by defining
+ * #NL_ASSERT_TRAP() before nlassert.h is included by the
+ * preprocessor, as shown in the following example:
+ *
+ * @code
+ * #if defined(__i386__) || defined(__x86_64__)
+ * #define DEBUGGER_TRAP __asm__ __volatile__("int3")
+ * #elif defined(__arm__)
+ * #define DEBUGGER_TRAP __asm__ __volatile__("bkpt")
+ * #endif
+ *
+ * #define NL_ASSERT_TRAP() \
+ * do \
+ * { \
+ * if (IsDebuggerAttached()) \
+ * { \
+ * DEBUGGER_TRAP; \
+ * } \
+ * } while (0)
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @note For the *_ACTION*-style assertion variants,
+ * #NL_ASSERT_TRAP() is a post-action trigger and will run
+ * after the specified action.
+ *
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#if !defined(NL_ASSERT_TRAP)
+#define NL_ASSERT_TRAP()
+#endif /* !defined(NL_ASSERT_TRAP) */
+
+/**
+ * @def NL_ASSERT_LOG_FORMAT_DEFAULT
+ *
+ * @brief
+ * This is the NULL-terminated C string literal with C Standard
+ * Library-style format specifiers used by #NL_ASSERT_LOG_DEFAULT.
+ *
+ * This may be used by overrides to #NL_ASSERT_LOG that want to use a
+ * consistent output formatting.
+ *
+ * @sa #NL_ASSERT_LOG_DEFAULT
+ *
+ */
+#define NL_ASSERT_LOG_FORMAT_DEFAULT "%s%s%s%s, %s%sfile: %s, line: %d\n"
+
+/**
+ * @def NL_ASSERT_LOG_DEFAULT(aPrefix, aName, aCondition, aLabel, aFile, aLine, aMessage)
+ *
+ * @brief
+ * This macro conforms to #NL_ASSERT_LOG and may be assigned to
+ * #NL_ASSERT_LOG, as shown in the following example, to display an
+ * assertion message when the assertion triggers, via the C
+ * Standard I/O Library error stream.
+ *
+ * @code
+ * #define NL_ASSERT_LOG(aPrefix, aName, aCondition, aLabel, aFile, aLine, aMessage) \
+ * NL_ASSERT_LOG_DEFAULT(aPrefix, aName, aCondition, aLabel, aFile, aLine, aMessage)
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @param[in] aPrefix A pointer to a NULL-terminated C string printed
+ * at the beginning of the logged assertion
+ * message. Typically this is and should be
+ * #NL_ASSERT_PREFIX_STRING.
+ * @param[in] aName A pointer to a NULL-terminated C string printed
+ * following @p aPrefix that indicates what
+ * module, program, application or subsystem
+ * the assertion occurred in Typically this
+ * is and should be
+ * #NL_ASSERT_COMPONENT_STRING.
+ * @param[in] aCondition A pointer to a NULL-terminated C string indicating
+ * the expression that evaluated to false in
+ * the assertion. Typically this is a
+ * stringified version of the actual
+ * assertion expression.
+ * @param[in] aLabel An optional pointer to a NULL-terminated C string
+ * indicating, for exception-style
+ * assertions, the label that will be
+ * branched to when the assertion expression
+ * evaluates to false.
+ * @param[in] aFile A pointer to a NULL-terminated C string indicating
+ * the file in which the exception
+ * occurred. Typically this is and should be
+ * \_\_FILE\_\_ from the C preprocessor or
+ * #NL_ASSERT_FILE.
+ * @param[in] aLine The line number in @p aFile on which the assertion
+ * expression evaluated to false. Typically
+ * this is and should be \_\_LINE\_\_ from the C
+ * preprocessor.
+ * @param[in] aMessage An optional pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_LOG
+ *
+ * @sa #NL_ASSERT_FLAG_LOG
+ *
+ * @sa #NL_ASSERT_PREFIX_STRING
+ * @sa #NL_ASSERT_COMPONENT_STRING
+ * @sa #NL_ASSERT_LOG_FORMAT_DEFAULT
+ *
+ * @sa #NL_ASSERT_FILE
+ *
+ */
+#define NL_ASSERT_LOG_DEFAULT(aPrefix, aName, aCondition, aLabel, aFile, aLine, aMessage) \
+ do \
+ { \
+ fprintf(stderr, \
+ NL_ASSERT_LOG_FORMAT_DEFAULT, \
+ aPrefix, \
+ (((aName) == 0) || (*(aName) == '\0')) ? "" : aName, \
+ (((aName) == 0) || (*(aName) == '\0')) ? "" : ": ", \
+ aCondition, \
+ ((aMessage == 0) ? "" : aMessage), \
+ ((aMessage == 0) ? "" : ", "), \
+ aFile, \
+ aLine); \
+ } while (0)
+
+/**
+ * @def NL_ASSERT_LOG(aPrefix, aName, aCondition, aLabel, aFile, aLine, aMessage)
+ *
+ * @brief
+ * This macro is invoked when an assertion expression evaluates to
+ * false when the macro has been configured with / passed
+ * #NL_ASSERT_FLAG_LOG.
+ *
+ * This is intended to display a message, to an appropriate log stream, informing the developer where the assertion was and what expression failed, similar to:
+ *
+ * "ASSERT: MyComponent: aPointer != NULL, bad pointer, file: foo.c, line: 453"
+ *
+ * Developers may override and customize this by defining
+ * #NL_ASSERT_LOG() before nlassert.h is included by the
+ * preprocessor.
+ *
+ * @note For the *_ACTION*-style assertion variants, #NL_ASSERT_LOG()
+ * is a pre-action trigger and will run before the specified action.
+ *
+ * @param[in] aPrefix A pointer to a NULL-terminated C string printed
+ * at the beginning of the logged assertion
+ * message. Typically this is and should be
+ * #NL_ASSERT_PREFIX_STRING.
+ * @param[in] aName A pointer to a NULL-terminated C string printed
+ * following @p aPrefix that indicates what
+ * module, program, application or subsystem
+ * the assertion occurred in Typically this
+ * is and should be
+ * #NL_ASSERT_COMPONENT_STRING.
+ * @param[in] aCondition A pointer to a NULL-terminated C string indicating
+ * the expression that evaluated to false in
+ * the assertion. Typically this is a
+ * stringified version of the actual
+ * assertion expression.
+ * @param[in] aLabel An optional pointer to a NULL-terminated C string
+ * indicating, for exception-style
+ * assertions, the label that will be
+ * branched to when the assertion expression
+ * evaluates to false.
+ * @param[in] aFile A pointer to a NULL-terminated C string indicating
+ * the file in which the exception
+ * occurred. Typically this is and should be
+ * \_\_FILE\_\_ from the C preprocessor or
+ * #NL_ASSERT_FILE.
+ * @param[in] aLine The line number in @p aFile on which the assertion
+ * expression evaluated to false. Typically
+ * this is and should be \_\_LINE\_\_ from the C
+ * preprocessor.
+ * @param[in] aMessage An optional pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_LOG_DEFAULT
+ *
+ * @sa #NL_ASSERT_FLAG_LOG
+ *
+ * @sa #NL_ASSERT_PREFIX_STRING
+ * @sa #NL_ASSERT_COMPONENT_STRING
+ *
+ * @sa #NL_ASSERT_FILE
+ *
+ */
+#if !defined(NL_ASSERT_LOG)
+#define NL_ASSERT_LOG(aPrefix, aName, aCondition, aLabel, aFile, aLine, aMessage)
+#endif /* !defined(NL_ASSERT_LOG) */
+
+/**
+ * @def NL_ASSERT_FILE
+ *
+ * @brief
+ * This is the NULL-terminated C string literal with the fully-,
+ * partially-, or non-qualified path of the file name in which an
+ * assertion occurred (default \_\_FILE\_\_).
+ *
+ * This may be used by developers to override the C preprocessor default,
+ * potentially shortening the size of string literals used for
+ * assertion file names and, consequently, decreasing the size of a
+ * particular target image.
+ *
+ */
+#if !defined(NL_ASSERT_FILE)
+#define NL_ASSERT_FILE __FILE__
+#endif /* !defined(NL_ASSERT_FILE) */
+
+/**
+ * @defgroup static-modality Static
+ * @defgroup assert-style Assert
+ * @defgroup abort-style Abort
+ * @defgroup check-style Check
+ * @defgroup verify-style Verify
+ * @defgroup precondition-style Precondition
+ * @defgroup expect-style Expect
+ * @defgroup desire-style Desire
+ * @defgroup require-style Require
+ *
+ */
+
+/**
+ * @ingroup static-modality
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def nlSTATIC_ASSERT(aCondition)
+ *
+ * @brief
+ * This checks, at compile-time, for the specified condition, which
+ * is expected to commonly be true, and terminates compilation if
+ * the condition is false.
+ *
+ * @note Unlike the runtime assert macros, this compile-time macro is active
+ * regardless of the state of #NL_ASSERT_PRODUCTION.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ *
+ * @sa #nlSTATIC_ASSERT_PRINT
+ *
+ */
+#define nlSTATIC_ASSERT(aCondition) _nlSTATIC_ASSERT(aCondition, #aCondition)
+
+/**
+ * @def nlSTATIC_ASSERT_PRINT(aCondition, aMessage)
+ *
+ * @brief
+ * This checks, at compile-time, for the specified condition, which
+ * is expected to commonly be true, and terminates compilation if
+ * the condition is false.
+ *
+ * @note Unlike the runtime assert macros, this compile-time macro is active
+ * regardless of the state of #NL_ASSERT_PRODUCTION.
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion
+ * failure. Note, this message is not
+ * actually emitted in any meaningful way for
+ * non-C11 or -C++11 code. It serves to
+ * simply comment or annotate the assertion
+ * and to provide interface parallelism with
+ * the run-time assertion interfaces.
+ *
+ * @sa #nlSTATIC_ASSERT
+ *
+ */
+#define nlSTATIC_ASSERT_PRINT(aCondition, aMessage) _nlSTATIC_ASSERT(aCondition, aMessage)
+
+/**
+ * @}
+ *
+ */
+
+/**
+ * @ingroup expect-style
+ *
+ * @{
+ *
+ */
+
+/**
+ * @def NL_ASSERT_EXPECT_FLAGS_DEFAULT
+ *
+ * @brief
+ * This defines the default behavioral flags for expect-style
+ * exception family assertions.
+ *
+ * This may be used to override #NL_ASSERT_EXPECT_FLAGS as follows:
+ *
+ * @code
+ * #define NL_ASSERT_EXPECT_FLAGS NL_ASSERT_EXPECT_FLAGS_DEFAULT
+ *
+ * #include <nlassert.h>
+ * @endcode
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ *
+ */
+#define NL_ASSERT_EXPECT_FLAGS_DEFAULT (NL_ASSERT_FLAG_NONE)
+
+/**
+ * @def NL_ASSERT_EXPECT_FLAGS
+ *
+ * @brief
+ * This defines the behavioral flags that govern the behavior for
+ * expect-style exception family assertions when the assertion
+ * expression evaluates to false.
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS_DEFAULT
+ *
+ * @sa #NL_ASSERT_FLAG_BACKTRACE
+ * @sa #NL_ASSERT_FLAG_LOG
+ * @sa #NL_ASSERT_FLAG_TRAP
+ */
+#if NL_ASSERT_USE_FLAGS_DEFAULT
+#define NL_ASSERT_EXPECT_FLAGS NL_ASSERT_EXPECT_FLAGS_DEFAULT
+#elif !defined(NL_ASSERT_EXPECT_FLAGS)
+#define NL_ASSERT_EXPECT_FLAGS (NL_ASSERT_FLAG_NONE)
+#endif
+
+/**
+ * @def nlEXPECT(aCondition, aLabel)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and branches to @p aLabel if the condition is
+ * false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlDESIRE
+ * @sa #nlREQUIRE
+ *
+ */
+#define nlEXPECT(aCondition, aLabel) __nlEXPECT(NL_ASSERT_EXPECT_FLAGS, aCondition, aLabel)
+
+/**
+ * @def nlEXPECT_PRINT(aCondition, aLabel, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both prints @p aMessage and then branches
+ * to @p aLabel if the condition is false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlDESIRE_PRINT
+ * @sa #nlREQUIRE_PRINT
+ *
+ */
+#define nlEXPECT_PRINT(aCondition, aLabel, aMessage) __nlEXPECT_PRINT(NL_ASSERT_EXPECT_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @def nlEXPECT_ACTION(aCondition, aLabel, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, and both executes @p anAction and branches to
+ * @p aLabel if the condition is false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlDESIRE_ACTION
+ * @sa #nlREQUIRE_ACTION
+ *
+ */
+#define nlEXPECT_ACTION(aCondition, aLabel, anAction) __nlEXPECT_ACTION(NL_ASSERT_EXPECT_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @def nlEXPECT_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true, prints @p aMessage, executes @p anAction, and
+ * branches to @p aLabel if the condition is false.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlDESIRE_ACTION_PRINT
+ * @sa #nlREQUIRE_ACTION_PRINT
+ *
+ */
+#define nlEXPECT_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlEXPECT_ACTION_PRINT(NL_ASSERT_EXPECT_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+/**
+ * @def nlEXPECT_SUCCESS(aStatus, aLabel)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and branches to @p
+ * aLabel if the status is unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlDESIRE_SUCCESS
+ * @sa #nlREQUIRE_SUCCESS
+ *
+ */
+#define nlEXPECT_SUCCESS(aStatus, aLabel) __nlEXPECT_SUCCESS(NL_ASSERT_EXPECT_FLAGS, aStatus, aLabel)
+
+/**
+ * @def nlEXPECT_SUCCESS_PRINT(aStatus, aLabel, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both prints @p
+ * aMessage and then branches to @p aLabel if the status is
+ * unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlDESIRE_SUCCESS_PRINT
+ * @sa #nlREQUIRE_SUCCESS_PRINT
+ *
+ */
+#define nlEXPECT_SUCCESS_PRINT(aStatus, aLabel, aMessage) __nlEXPECT_SUCCESS_PRINT(NL_ASSERT_EXPECT_FLAGS, aStatus, aLabel, aMessage)
+
+/**
+ * @def nlEXPECT_SUCCESS_ACTION(aStatus, aLabel, anAction)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), and both executes @p
+ * anAction and branches to @p aLabel if the status is unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlDESIRE_SUCCESS_ACTION
+ * @sa #nlREQUIRE_SUCCESS_ACTION
+ *
+ */
+#define nlEXPECT_SUCCESS_ACTION(aStatus, aLabel, anAction) __nlEXPECT_SUCCESS_ACTION(NL_ASSERT_EXPECT_FLAGS, aStatus, aLabel, anAction)
+
+/**
+ * @def nlEXPECT_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage)
+ *
+ * @brief
+ * This checks for the specified status, which is expected to
+ * commonly be successful (i.e. zero (0)), prints @p aMessage,
+ * executes @p anAction, and branches to @p aLabel if the status is
+ * unsuccessful.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aStatus A scalar status to be evaluated against zero (0).
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aStatus does not evaluate to zero
+ * (0).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlDESIRE_SUCCESS_ACTION_PRINT
+ * @sa #nlREQUIRE_SUCCESS_ACTION_PRINT
+ *
+ */
+#define nlEXPECT_SUCCESS_ACTION_PRINT(aStatus, aLabel, anAction, aMessage) __nlEXPECT_SUCCESS_ACTION_PRINT(NL_ASSERT_EXPECT_FLAGS, aStatus, aLabel, anAction, aMessage)
+
+/**
+ * @def nlNEXPECT(aCondition, aLabel)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and branches to @p aLabel if the condition is
+ * true.
+ *
+ * @note This is the logical inverse of #nlEXPECT.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlEXPECT
+ * @sa #nlNDESIRE
+ * @sa #nlNREQUIRE
+ *
+ */
+#define nlNEXPECT(aCondition, aLabel) __nlNEXPECT(NL_ASSERT_EXPECT_FLAGS, aCondition, aLabel)
+
+/**
+ * @def nlNEXPECT_PRINT(aCondition, aLabel, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both prints @p aMessage and then branches
+ * to @p aLabel if the condition is true.
+ *
+ * @note This is the logical inverse of #nlEXPECT_PRINT.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlEXPECT_PRINT
+ * @sa #nlNDESIRE_PRINT
+ * @sa #nlNREQUIRE_PRINT
+ *
+ */
+#define nlNEXPECT_PRINT(aCondition, aLabel, aMessage) __nlNEXPECT_PRINT(NL_ASSERT_EXPECT_FLAGS, aCondition, aLabel, aMessage)
+
+/**
+ * @def nlNEXPECT_ACTION(aCondition, aLabel, anAction)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, and both executes @p anAction and branches to
+ * @p aLabel if the condition is true.
+ *
+ * @note This is the logical inverse of #nlEXPECT_ACTION.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlEXPECT_ACTION
+ * @sa #nlNDESIRE_ACTION
+ * @sa #nlNREQUIRE_ACTION
+ *
+ */
+#define nlNEXPECT_ACTION(aCondition, aLabel, anAction) __nlNEXPECT_ACTION(NL_ASSERT_EXPECT_FLAGS, aCondition, aLabel, anAction)
+
+/**
+ * @def nlNEXPECT_ACTION_PRINT(aCondition, aLabel, anAction, aMessage)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be false, prints @p aMessage, executes @p anAction, and
+ * branches to @p aLabel if the condition is true.
+ *
+ * @note This is the logical inverse of #nlEXPECT_ACTION_PRINT.
+ *
+ * __Anticipated Assertion Firing Frequency:__ Frequent
+ *
+ * @param[in] aCondition A Boolean expression to be evaluated.
+ * @param[in] aLabel The local label to which execution branches
+ * when @p aCondition evaluates to false (i.e.
+ * compares equal to zero).
+ * @param[in] anAction An expression or block to execute when the
+ * assertion fails. This will be executed
+ * after #NL_ASSERT_LOG() and
+ * #NL_ASSERT_BACKTRACE() but before
+ * #NL_ASSERT_TRAP().
+ * @param[in] aMessage A pointer to a NULL-terminated C string
+ * containing a caller-specified message
+ * further describing the assertion failure.
+ *
+ * @sa #NL_ASSERT_EXPECT_FLAGS
+ *
+ * @sa #nlEXPECT_ACTION_PRINT
+ * @sa #nlNDESIRE_ACTION_PRINT
+ * @sa #nlNREQUIRE_ACTION_PRINT
+ *
+ */
+#define nlNEXPECT_ACTION_PRINT(aCondition, aLabel, anAction, aMessage) __nlNEXPECT_ACTION_PRINT(NL_ASSERT_EXPECT_FLAGS, aCondition, aLabel, anAction, aMessage)
+
+/**
+ * @}
+ *
+ */
+
+#if !NL_ASSERT_PRODUCTION
+#include "nlassert-nonproduction.h"
+#else
+#include "nlassert-production.h"
+#endif /* !NL_ASSERT_PRODUCTION */
+
+#endif /* NLCORE_NLASSERT_H */
diff --git a/include/stdc/assert.h b/include/stdc/assert.h
new file mode 100644
index 0000000..9e729d6
--- /dev/null
+++ b/include/stdc/assert.h
@@ -0,0 +1,81 @@
+/*
+ *
+ * Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * @file
+ * This file provides an ISO/IEC 9899:1999-, C89-, and
+ * C99-compatible Standard C Library header and assertion
+ * interface definition, implemented atop Nest Labs assertion
+ * checking and runtime exception interfaces such that consistent
+ * platform and system capabilities, behavior, and output may
+ * be implemented and enforced across the two interfaces.
+ *
+ * Systems wishing to use this in lieu of their Standard C
+ * Library header of the same name should ensure that their
+ * toolchain is configured to either ignore or deprioritize
+ * standard search paths while placing the directory this header
+ * is contained in among the preferred header search paths.
+ *
+ */
+
+#ifndef NL_ASSERT_STDC_ASSERT_H
+#define NL_ASSERT_STDC_ASSERT_H
+
+#include <nlassert.h>
+
+/**
+ * @def assert(aExpression)
+ *
+ * @brief
+ * This checks for the specified condition, which is expected to
+ * commonly be true and takes action, based on configuration, and
+ * aborts the current program execution if the condition is false.
+ *
+ * This provides a workalike macro for the ISO/IEC 9899:1999, C89,
+ * and C99 Standard C Library
+ * [assert()](http://pubs.opengroup.org/onlinepubs/009695399/functions/assert.html)
+ * macro interface and bases it upon the equivalent #nlABORT macro,
+ * which has the same semantics, and the same behavior when active. The
+ * difference between the #nlABORT macro and this assert() macro is that
+ * #nlABORT is always active, while this one is inactive when NDEBUG is
+ * defined and active when NDEBUG is undefined. Note that when this macro
+ * is inactive, the test is __completely__ elided; side effects, if any,
+ * in the tested expression will not be produced.
+ *
+ * System integrators may want to use this as opposed to their native
+ * Standard C Library assert() to ensure consistent capabilities,
+ * behavior, and output across their software modules when runtime
+ * assertions occur where the Nest Labs assertion checking and
+ * runtime exception handling is also used.
+ *
+ * @param[in] aExpression A Boolean expression to be evaluated.
+ *
+ * @sa #nlASSERT
+ *
+ */
+#ifdef NDEBUG
+#ifdef __cplusplus
+#define assert(aExpression) (static_cast<void> (0))
+#else
+#define assert(aExpression) ((void) (0))
+#endif
+#else
+#define assert(aExpression) nlABORT(aExpression)
+#endif
+
+#endif /* NL_ASSERT_STDC_ASSERT_H */