This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
clarify how to enable -DPERL_USE_SAFE_PUTENV
[perl5.git] / epoc / epocish.c
CommitLineData
3a2f06e9
GS
1/*
2 * Copyright (c) 1999 Olaf Flebbe o.flebbe@gmx.de
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Artistic License, as specified in the README file.
6 *
7 */
8
b250498f 9/* This is C++ Code !! */
3a2f06e9
GS
10
11#include <e32std.h>
d5ff79b3
OF
12#include <stdlib.h>
13#include <estlib.h>
14#include <string.h>
3a2f06e9
GS
15
16extern "C" {
17
3a2f06e9 18
d5ff79b3
OF
19/* Workaround for defect strtoul(). Values with leading + are zero */
20
21unsigned long int epoc_strtoul(const char *nptr, char **endptr,
22 int base) {
23 if (nptr && *nptr == '+')
24 nptr++;
25 return strtoul( nptr, endptr, base);
26}
b250498f 27
d5ff79b3 28void epoc_gcvt( double x, int digits, unsigned char *buf) {
b250498f
GS
29 TRealFormat trel;
30
31 trel.iPlaces = digits;
32 trel.iPoint = TChar( '.');
33
34 TPtr result( buf, 80);
35
36 result.Num( x, trel);
37 result.Append( TChar( 0));
38 }
3a2f06e9 39}
d5ff79b3 40
85ca448a 41