2014-12-11 Keith Marshall <keithmarshall@users.sourceforge.net>
+ Another CRT_INLINE function implementation rationalization.
+
+ * include/inttypes.h (imaxabs): Specify as __LIBIMPL__; declare...
+ (llabs): ...this, to be implemented as its __LIBIMPL__ alias.
+ [__cplusplus] (_BEGIN_C_DECLS, _END_C_DECLS): Use these.
+
+ * Makefile.in (libimpl_sed_script): Handle ALIAS attribute.
+ (libmingwex.a): Delete obsolete dependency on...
+ (imaxabs.$OBJEXT): ...this.
+
+ * mingwex/imaxabs.c: File is now redundant; delete it.
+
+2014-12-11 Keith Marshall <keithmarshall@users.sourceforge.net>
+
More rationalization of CRT_INLINE function implementations.
* include/stdio.h (fopen64): Add __JMPSTUP__ specification.
* mingwex/stdio/fopen64.c: File is now redundant; delete it.
* mingwex/stdio/ftell064.c: Likewise.
- * Makefile.in (libmingwex.a): Delete obsolete dependencies...
+ * Makefile.in (libmingwex.a): Delete obsolete dependencies on...
(fopen64.$OBJEXT, ftello64.$OBJEXT): ...these.
2014-12-11 Keith Marshall <keithmarshall@users.sourceforge.net>
# "inttypes" conversion routines, provided in libmingwex.a
#
libmingwex.a: $(addsuffix .$(OBJEXT), \
- imaxabs imaxdiv strtoimax strtoumax wcstoimax wcstoumax)
+ imaxdiv strtoimax strtoumax wcstoimax wcstoumax)
# Additional math functions, augmenting Microsoft's paltry
# selection, also delivered in libmingwex.a, (FIXME: and yet
# which identifies the originating file as a system header).
#
libimpl_sed_script = sed \
- -e '/__CRT_ALIAS *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d' \
+ -e '/pragma .* system_header/d' \
-e '/__CRT_INLINE *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d' \
- -e '/pragma .* system_header/d'
+ -e 's/__LIBIMPL.*ALIAS *= *$1[ ,)].*)/__attribute__((__alias__("$1")))/' \
+ -e '/__CRT_ALIAS *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d'
LIBIMPL_CFLAGS = $(CFLAGS) $(INCLUDES) -fno-align-functions
#define __need_wchar_t
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+_BEGIN_C_DECLS
typedef struct {
intmax_t quot;
intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j);
#ifndef __NO_INLINE__
-__CRT_INLINE intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j)
- {return (j >= 0 ? j : -j);}
+__CRT_INLINE __LIBIMPL__(( FUNCTION = imaxabs ))
+intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t __j)
+{ return __j >= 0 ? __j : -__j; }
+
+/* Since intmax_t is effectively analogous to long long, the preceding
+ * implementation will serve admirably as the external representation of
+ * both imaxabs() and llabs(); declare so here, by providing a prototype
+ * only, with the corresponding inline implementation in stdlib.h
+ */
+__CRT_INLINE __LIBIMPL__(( ALIAS = imaxabs ))
+long long llabs (long long);
#endif
+
imaxdiv_t __cdecl __MINGW_NOTHROW imaxdiv (intmax_t numer, intmax_t denom);
/* 7.8.2 Conversion functions for greatest-width integer types */
uintmax_t __cdecl __MINGW_NOTHROW wcstoumax (const wchar_t* __restrict__ nptr,
wchar_t** __restrict__ endptr, int base);
-#ifdef __cplusplus
-}
-#endif
+_END_C_DECLS
#endif /* ndef _INTTYPES_H */
+++ /dev/null
-/*
- This source code was extracted from the Q8 package created and
- placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
- last edit: 1999/11/05 gwyn@arl.mil
-
- Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E).
-
- This particular implementation requires the matching <inttypes.h>.
-*/
-
-#include <inttypes.h>
-
-intmax_t
-imaxabs (intmax_t _j)
- { return _j >= 0 ? _j : -_j; }
-
-long long __attribute__ ((alias ("imaxabs"))) llabs (long long);