Mercurial > ecos
annotate packages/language/c/libc/current/src/stdlib/atof.cxx @ 64:c38311975d4f ecos-sw-2000-01-28
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
| author | jlarmour |
|---|---|
| date | Fri, 28 Jan 2000 04:59:39 +0000 |
| parents | 443894e2e912 |
| children | bf00f99aec69 |
| rev | line source |
|---|---|
| 0 | 1 //=========================================================================== |
| 2 // | |
| 3 // atof.cxx | |
| 4 // | |
| 5 // Real alternative for inline implementation of the ANSI standard | |
| 6 // atof() utility function defined in section 7.10.1.1 of the standard | |
| 7 // | |
| 8 //=========================================================================== | |
| 9 //####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
10 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
11 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
12 // The contents of this file are subject to the Red Hat eCos Public License |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
13 // Version 1.0 (the "License"); you may not use this file except in |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
14 // compliance with the License. You may obtain a copy of the License at |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
15 // http://sourceware.cygnus.com/ecos |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
16 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
17 // Software distributed under the License is distributed on an |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
18 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
19 // License for the specific language governing rights and limitations under |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
20 // the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
21 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
22 // The Original Code is eCos - Embedded Configurable Operating System, |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
23 // released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
24 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
25 // The Initial Developer of the Original Code is Red Hat. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
26 // Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
27 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
28 // All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
29 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
30 // |
| 0 | 31 //####COPYRIGHTEND#### |
| 32 //=========================================================================== | |
| 33 //#####DESCRIPTIONBEGIN#### | |
| 34 // | |
| 35 // Author(s): jlarmour | |
| 2 | 36 // Contributors: jlarmour |
| 0 | 37 // Date: 1998-02-13 |
| 38 // Purpose: | |
| 39 // Description: | |
| 40 // Usage: | |
| 41 // | |
| 42 //####DESCRIPTIONEND#### | |
| 43 // | |
| 44 //=========================================================================== | |
| 45 | |
| 46 // CONFIGURATION | |
| 47 | |
| 48 #include <pkgconf/libc.h> // Configuration header | |
| 49 | |
| 50 // Include the C library? And strtod() which we use? | |
| 51 #if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtod) | |
| 52 | |
| 53 // INCLUDES | |
| 54 | |
| 55 #include <cyg/infra/cyg_type.h> // Common type definitions and support | |
| 56 #include <cyg/infra/cyg_trac.h> // Tracing support | |
| 57 #include <cyg/infra/cyg_ass.h> // Assertion support | |
| 58 | |
| 59 // We don't want the inline versions of stdlib functions defined here | |
| 60 | |
| 61 #ifdef CYGIMP_LIBC_STDLIB_INLINES | |
| 62 #undef CYGIMP_LIBC_STDLIB_INLINES | |
| 63 #endif | |
| 64 | |
| 65 #include <stddef.h> // NULL, wchar_t and size_t from compiler | |
| 66 #include <stdlib.h> // Main header for stdlib functions | |
| 67 #include "clibincl/stdlibsupp.hxx" // Support for stdlib functions | |
| 68 | |
| 69 | |
| 70 // EXPORTED SYMBOLS | |
| 71 | |
| 72 externC double | |
| 73 atof( const char * ) CYGPRI_LIBC_WEAK_ALIAS("_atof"); | |
| 74 | |
| 75 | |
| 76 // FUNCTIONS | |
| 77 | |
| 78 double | |
| 79 _atof( const char *nptr ) | |
| 80 { | |
| 81 double retval; | |
| 82 | |
| 83 CYG_REPORT_FUNCNAMETYPE( "_atof", "returning %f" ); | |
| 84 | |
| 85 CYG_CHECK_DATA_PTR( nptr, "nptr is an invalid pointer!" ); | |
| 86 | |
| 87 retval = _strtod( nptr, (char **)NULL ); | |
| 88 | |
| 89 CYG_REPORT_RETVAL( retval ); | |
| 90 | |
| 91 return retval; | |
| 92 } // _atof() | |
| 93 | |
| 94 | |
| 95 #endif // if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtod) | |
| 96 | |
| 97 // EOF atof.cxx |
