xref: /netbsd-src/common/lib/libc/stdlib/strtoull.c (revision a67fde035671e323b0b50374f03950beac2f97f2)
1*a67fde03Sjoerg /* $NetBSD: strtoull.c,v 1.6 2013/04/16 21:44:06 joerg Exp $ */
282fd1ebbSthorpej 
3245e0863Sjoerg /*-
4245e0863Sjoerg  * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
5245e0863Sjoerg  * Copyright (c) 2003 Citrus Project,
6245e0863Sjoerg  * All rights reserved.
782fd1ebbSthorpej  *
882fd1ebbSthorpej  * Redistribution and use in source and binary forms, with or without
982fd1ebbSthorpej  * modification, are permitted provided that the following conditions
1082fd1ebbSthorpej  * are met:
1182fd1ebbSthorpej  * 1. Redistributions of source code must retain the above copyright
1282fd1ebbSthorpej  *    notice, this list of conditions and the following disclaimer.
1382fd1ebbSthorpej  * 2. Redistributions in binary form must reproduce the above copyright
1482fd1ebbSthorpej  *    notice, this list of conditions and the following disclaimer in the
1582fd1ebbSthorpej  *    documentation and/or other materials provided with the distribution.
1682fd1ebbSthorpej  *
17245e0863Sjoerg  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1882fd1ebbSthorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1982fd1ebbSthorpej  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20245e0863Sjoerg  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2182fd1ebbSthorpej  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2282fd1ebbSthorpej  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2382fd1ebbSthorpej  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2482fd1ebbSthorpej  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2582fd1ebbSthorpej  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2682fd1ebbSthorpej  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2782fd1ebbSthorpej  * SUCH DAMAGE.
2882fd1ebbSthorpej  */
2982fd1ebbSthorpej 
303ae58345Sjoerg #if HAVE_NBTOOL_CONFIG_H
313ae58345Sjoerg #include "nbtool_config.h"
323ae58345Sjoerg #endif
333ae58345Sjoerg 
3482fd1ebbSthorpej #include <sys/cdefs.h>
35*a67fde03Sjoerg __RCSID("$NetBSD: strtoull.c,v 1.6 2013/04/16 21:44:06 joerg Exp $");
36331139bdSmatt 
37331139bdSmatt #ifdef _LIBC
38331139bdSmatt #include "namespace.h"
39331139bdSmatt #endif
4082fd1ebbSthorpej 
415577c7fcSoster #if defined(_KERNEL)
425577c7fcSoster #include <sys/param.h>
435577c7fcSoster #include <lib/libkern/libkern.h>
445577c7fcSoster #elif defined(_STANDALONE)
455577c7fcSoster #include <sys/param.h>
465577c7fcSoster #include <lib/libkern/libkern.h>
475577c7fcSoster #include <lib/libsa/stand.h>
485577c7fcSoster #else
4982fd1ebbSthorpej #include <assert.h>
5082fd1ebbSthorpej #include <ctype.h>
5182fd1ebbSthorpej #include <errno.h>
5282fd1ebbSthorpej #include <limits.h>
53245e0863Sjoerg #include <stdint.h>
5482fd1ebbSthorpej #include <stdlib.h>
5582fd1ebbSthorpej #endif
5682fd1ebbSthorpej 
57245e0863Sjoerg #define	_FUNCNAME	strtoull
58245e0863Sjoerg #define	__UINT		unsigned long long int
59245e0863Sjoerg #define	__UINT_MAX	ULLONG_MAX
6082fd1ebbSthorpej 
61245e0863Sjoerg #include "_strtoul.h"
6282fd1ebbSthorpej 
63331139bdSmatt #ifdef _LIBC
64331139bdSmatt __weak_alias(strtoull, _strtoull)
65*a67fde03Sjoerg __weak_alias(strtoull_l, _strtoull_l)
6682fd1ebbSthorpej #endif
67