You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2017/08/07 23:02:29 UTC

[2/4] mesos git commit: Added an async signal safe ASSERT to stout.

Added an async signal safe ASSERT to stout.

Review: https://reviews.apache.org/r/61475


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/eb06f4db
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/eb06f4db
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/eb06f4db

Branch: refs/heads/master
Commit: eb06f4db61ae09adbd12cd24a6a8a31a80fdc6f2
Parents: 2c1b420
Author: Jie Yu <yu...@gmail.com>
Authored: Mon Aug 7 11:44:09 2017 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon Aug 7 16:02:24 2017 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/Makefile.am      |  1 +
 3rdparty/stout/include/stout/assert.hpp | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/eb06f4db/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/Makefile.am b/3rdparty/stout/include/Makefile.am
index 80724f4..bdd3e99 100644
--- a/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/stout/include/Makefile.am
@@ -14,6 +14,7 @@
 nobase_include_HEADERS =			\
   stout/abort.hpp				\
   stout/adaptor.hpp				\
+  stout/assert.hpp				\
   stout/attributes.hpp				\
   stout/base64.hpp				\
   stout/boundedhashmap.hpp			\

http://git-wip-us.apache.org/repos/asf/mesos/blob/eb06f4db/3rdparty/stout/include/stout/assert.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/assert.hpp b/3rdparty/stout/include/stout/assert.hpp
new file mode 100644
index 0000000..c82b58b
--- /dev/null
+++ b/3rdparty/stout/include/stout/assert.hpp
@@ -0,0 +1,26 @@
+// 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.
+
+#ifndef __STOUT_ASSERT_HPP__
+#define __STOUT_ASSERT_HPP__
+
+#include <stout/abort.hpp>
+
+// Provide an async signal safe version `assert`. Please use `assert`
+// instead if you don't need async signal safety.
+#ifdef NDEBUG
+#define ASSERT(e) ((void) 0)
+#else
+#define ASSERT(e) ((void) ((e) ? ((void) 0) : ABORT(#e)))
+#endif
+
+#endif // __STOUT_ASSERT_HPP__