summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaureen Helm <maureen.helm@nxp.com>2016-07-14 14:20:21 -0500
committerInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>2016-07-21 02:09:44 +0000
commit0a9e0d0a5eae67fd72b90dc79568a9776e2b6d67 (patch)
tree8c1036a93ec16fe1c2b45ae0d5c0cd50462f38f5 /lib
parentaebe38465f3888589135fc9903dc7b460f39c231 (diff)
libc: Add assert.h to minimal libc
This is an adaptation of net/ip/tinydtls/platform-specific/config-zephyr.h to allow external imports such as KSDK to include assert.h. Change-Id: I0afee37deb79447363037ba6b4bb9cdbc629be3a Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/minimal/include/assert.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/libc/minimal/include/assert.h b/lib/libc/minimal/include/assert.h
new file mode 100644
index 000000000..39e8dace7
--- /dev/null
+++ b/lib/libc/minimal/include/assert.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016 Intel Corporation
+ * Copyright (c) 2016, Freescale Semiconductor, Inc.
+ *
+ * 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 __INC_assert_h__
+#define __INC_assert_h__
+
+#include <misc/__assert.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef NDEBUG
+#ifndef assert
+#define assert(test) __ASSERT_NO_MSG(test)
+#endif
+#else
+#ifndef assert
+#define assert(test)
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __INC_assert_h__ */