ReactOS 0.4.16-dev-2104-gb84fa49
strtoul.c
Go to the documentation of this file.
1#include <precomp.h>
2
3/* Based on Wine Staging 1.9.9 - dlls/msvcrt/string.c */
4/******************************************************************
5 * _strtoul_l (MSVCRT.@)
6 */
7unsigned long CDECL _strtoul_l(const char* nptr, char** end, int base, _locale_t locale)
8{
10
11 if(ret > ULONG_MAX) {
12 ret = ULONG_MAX;
13#ifndef _LIBCNT_
14 *_errno() = ERANGE;
15#endif
16 }else if(ret < -(__int64)ULONG_MAX) {
17 ret = 1;
18#ifndef _LIBCNT_
19 *_errno() = ERANGE;
20#endif
21 }
22
23 return ret;
24}
25
26/******************************************************************
27 * strtoul (MSVCRT.@)
28 */
29unsigned long CDECL strtoul(const char* nptr, char** end, int base)
30{
31 return _strtoul_l(nptr, end, base, NULL);
32}
Definition: _locale.h:75
#define NULL
Definition: types.h:112
#define CDECL
Definition: compat.h:29
int *CDECL _errno(void)
Definition: errno.c:215
#define __int64
Definition: corecrt.h:72
#define ERANGE
Definition: errno.h:55
#define ULONG_MAX
Definition: limits.h:31
_ACRTIMP __int64 __cdecl _strtoi64_l(const char *, char **, int, _locale_t)
Definition: string.c:1617
return ret
Definition: mutex.c:146
GLuint GLuint end
Definition: gl.h:1545
unsigned long CDECL strtoul(const char *nptr, char **end, int base)
Definition: strtoul.c:29
unsigned long CDECL _strtoul_l(const char *nptr, char **end, int base, _locale_t locale)
Definition: strtoul.c:7