1bad3168bSMichael Jones //===-- Implementation of atol --------------------------------------------===//
2bad3168bSMichael Jones //
3bad3168bSMichael Jones // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4bad3168bSMichael Jones // See https://llvm.org/LICENSE.txt for license information.
5bad3168bSMichael Jones // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6bad3168bSMichael Jones //
7bad3168bSMichael Jones //===----------------------------------------------------------------------===//
8bad3168bSMichael Jones 
9bad3168bSMichael Jones #include "src/stdlib/atol.h"
10bad3168bSMichael Jones #include "src/__support/common.h"
11*31d797f4SMichael Jones #include "src/__support/str_to_integer.h"
12bad3168bSMichael Jones 
13bad3168bSMichael Jones namespace __llvm_libc {
14bad3168bSMichael Jones 
15bad3168bSMichael Jones LLVM_LIBC_FUNCTION(long, atol, (const char *str)) {
16bad3168bSMichael Jones   return internal::strtointeger<long>(str, nullptr, 10);
17bad3168bSMichael Jones }
18bad3168bSMichael Jones 
19bad3168bSMichael Jones } // namespace __llvm_libc
20