grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / muimaster / support_aros.c
blobe26bfacb17fd3b299e7f40ddc47c3977c6a91904
1 /*
2 Copyright © 2003, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #include <stdlib.h>
10 #include <exec/types.h>
12 #include "support_aros.h"
14 /***************************************************
15 Like StrToLong() but for hex numbers
16 that represent addresses
17 ***************************************************/
18 #ifdef __AROS__
19 LONG HexToIPTR(CONST_STRPTR s, IPTR *val)
21 char *end;
22 *val = (IPTR)strtoull(s,&end,16);
23 if (end == (char*)s) return -1;
24 return end - (char*)s;
26 LONG HexToLong(CONST_STRPTR s, ULONG *val)
28 char *end;
29 *val = (ULONG)strtoul(s,&end,16);
30 if (end == (char*)s) return -1;
31 return end - (char*)s;
33 #else
34 LONG HexToIPTR(CONST_STRPTR s, IPTR *val)
36 return HexToLong((STRPTR)s, val);
38 #endif