summaryrefslogtreecommitdiff
path: root/libc/src/stdlib/abs.h
diff options
context:
space:
mode:
authorCheng Wang <chennngwang@gmail.com>2020-12-03 20:17:24 +0800
committerCheng Wang <chennngwang@gmail.com>2020-12-11 09:25:20 +0800
commit1fd32dcb294e16781fcfcf1a468180d00cf1e3ca (patch)
tree4e430b88e6df710581974f17a84b7cd3f09eeaf3 /libc/src/stdlib/abs.h
parente52881a2870234f0dad6e338a0f084eddeaa9356 (diff)
[libc] Add [l|ll]abs implementation.
Implement abs, labs and llabs with template. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D92626
Diffstat (limited to 'libc/src/stdlib/abs.h')
-rw-r--r--libc/src/stdlib/abs.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libc/src/stdlib/abs.h b/libc/src/stdlib/abs.h
new file mode 100644
index 000000000000..42ef7f885ed6
--- /dev/null
+++ b/libc/src/stdlib/abs.h
@@ -0,0 +1,18 @@
+//===-- Implementation header for abs ---------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_STDLIB_ABS_H
+#define LLVM_LIBC_SRC_STDLIB_ABS_H
+
+namespace __llvm_libc {
+
+int abs(int n);
+
+} // namespace __llvm_libc
+
+#endif // LLVM_LIBC_SRC_STDLIB_ABS_H