Quantcast

Expose atoll properly

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Expose atoll properly

Pedro Alves-4
Hi guys,

  going through the backlog I noticed the patch that exposed
atoll on C99.  I've applied the patch below to our mingw32ce headers
to fix a few things I noticed.  We should not pick up the inline version
if __NO_INLINE__ is defined (`gcc -fno-inline', or `gcc -O0' defines that).
We can pedal on __STDC_VERSION__ to declare/define atoll even if
__STRICT_ANSI__ is defined.  The declaration for the out-of-line
version (in libmingwex.a) was missing.

Please let me know if something breaks.

--
Pedro Alves

2010-01-02  Pedro Alves  <[hidden email]>

        * include/stdlib.h (atoll): Don't define the inline version with
        __NO_INLINE__ is defined.  Don't define or declare if
        __STRICT_ANSI__ is defined, unless compiling for C99 or above.
        Add missing declaration for out-of-line copy.

---
 include/stdlib.h |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

Index: mingw/include/stdlib.h
===================================================================
--- mingw.orig/include/stdlib.h 2010-01-02 00:38:07.000000000 +0000
+++ mingw/include/stdlib.h 2010-01-02 00:38:37.000000000 +0000
@@ -562,13 +562,27 @@ __CRT_INLINE long long __cdecl __MINGW_N
   {return (_j >= 0 ? _j : -_j);}
 #endif
 
-/* C99 addition, this used to be blocked by __STRICT_ANSI__ (see below). */
+#ifndef __NO_INLINE__
+#if (!defined (__STRICT_ANSI__) \
+     || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L))
 __CRT_INLINE long long  __cdecl __MINGW_NOTHROW atoll (const char * _c)
  { return _atoi64 (_c); }
+#endif
+#endif
 
 long long  __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int);
 unsigned long long  __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int);
 
+/* these are stubs for MS _i64 versions */
+#if defined (__MSVCRT__) || defined (__COREDLL__)
+
+#if (!defined (__STRICT_ANSI__) \
+     || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L))
+long long  __cdecl __MINGW_NOTHROW atoll (const char * _c);
+#endif
+
+#endif
+
 #if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
 
 #if !defined (__STRICT_ANSI__)

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Loading...