Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / utility / gmxassert.h
index 48a142d7022a0682dce08a07461c2c1f9612e266..a919080d3259d00b214cf8c37ebb1057f83ae636 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
  *
  * GROMACS is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
 #define GMX_UTILITY_GMXASSERT_H
 
 #include <boost/current_function.hpp>
-#include <boost/exception/detail/attribute_noreturn.hpp>
 
-/*! \addtopublicapi
- * \{
- */
+#include "gromacs/utility/basedefinitions.h"
 
-/*! \brief
+//! \addtogroup module_utility
+//! \{
+
+/*! \def GMX_RELEASE_ASSERT
+ * \brief
  * Macro for asserts that should also be present in the release version.
  *
  * Regardless of NDEBUG, this macro checks \p condition, and if it is not true,
  * should only be used in a context where it is safe to throw an exception to
  * keep the option open.
  */
+#ifdef GMX_DISABLE_ASSERTS
+#define GMX_RELEASE_ASSERT(condition, msg)
+#else
 #define GMX_RELEASE_ASSERT(condition, msg) \
     ((void) ((condition) ? (void)0 : \
              ::gmx::internal::assertHandler(#condition, msg, \
                                             BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)))
+#endif
 /*! \def GMX_ASSERT
  * \brief
  * Macro for debug asserts.
@@ -79,7 +84,7 @@
 #define GMX_ASSERT(condition, msg) GMX_RELEASE_ASSERT(condition, msg)
 #endif
 
-/*!\}*/
+//! \}
 
 namespace gmx
 {
@@ -96,7 +101,7 @@ namespace internal
  *
  * \ingroup module_utility
  */
-BOOST_ATTRIBUTE_NORETURN
+gmx_noreturn
 void assertHandler(const char *condition, const char *msg,
                    const char *func, const char *file, int line);