+2017-01-30 Keith Marshall <keithmarshall@users.sourceforge.net>
+
+ Remove duplicate libmingwex.a entries.
+
+ * mingwex/jmpstub.sx (DLLENTRY): Interpret it.
+
+ * Makefile.in (jmpstub_awk_script): Handle DLLENTRY.
+ (libmingwex.a): Remove explicit object file references to...
+ (snwprintf, vsnwprintf): ...these.
+
+ * include/stdio.h (snwprintf, vsnwprintf): Map them as __JMPSTUB__
+ references to MSVCRT.DLL entry points, via DLLENTRY references to...
+ (_snwprintf, _vsnwprintf): ...these, respectively.
+
+ * mingwex/snwprintf.c: Redundant file; delete it.
+ * mingwex/vsnwprintf.c: Likewise.
+
2017-01-29 Keith Marshall <keithmarshall@users.sourceforge.net>
Clean up <limits.h> header file.
#
vpath %.c ${mingwrt_srcdir}/mingwex/stdio
libmingwex.a: $(addsuffix .$(OBJEXT), btowc fprintf fseeko64 ofmtctl pformat \
- printf snprintf snwprintf sprintf vfprintf vfscanf vfwscanf vprintf vscanf \
- vsnprintf vsnwprintf vsprintf vsscanf vswscanf vwscanf)
+ printf snprintf sprintf vfprintf vfscanf vfwscanf vprintf vscanf vsnprintf \
+ vsprintf vsscanf vswscanf vwscanf)
# pformat.$(OBJEXT) needs an explicit build rule, since we need to
# specify an additional header file path.
LIB = match( $$0, ".*[ ,(:]LIB *= *"symbol, altlib ) ? altlib[1] : "mingwex"; \
OBJNAME = gensub( "_*(.*)_*", "\\1", 1, FUNCTION )".jmpstub.$$(OBJEXT)"; \
OBJNAME_CFLAGS = "-D FUNCTION="FUNCTION; \
- if( match( $$0, ".*[ ,(:]REMAPPED *= *"symbol, alias ) ) \
+ if( match( $$0, ".*[ ,(:]DLLENTRY *= *"symbol, alias ) ) \
+ OBJNAME_CFLAGS = OBJNAME_CFLAGS" -D DLLENTRY="alias[1]; \
+ else if( match( $$0, ".*[ ,(:]REMAPPED *= *"symbol, alias ) ) \
OBJNAME_CFLAGS = OBJNAME_CFLAGS" -D REMAPPED="alias[1]; \
printf fmt, LIB, OBJNAME, OBJNAME, OBJNAME_CFLAGS; \
} \
* $Id$
*
* Written by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
- * Copyright (C) 1997-2005, 2007-2010, 2014-2016, MinGW.org Project.
+ * Copyright (C) 1997-2005, 2007-2010, 2014-2017, MinGW.org Project.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
#endif /* __MSVCRT__ */
#ifdef _ISOC99_SOURCE
+__JMPSTUB__(( FUNCTION = snwprintf, DLLENTRY = _snwprintf ))
__cdecl __MINGW_NOTHROW int snwprintf (wchar_t *, size_t, const wchar_t *, ...);
__cdecl __MINGW_NOTHROW int vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST);
#ifndef __NO_INLINE__
__CRT_INLINE __cdecl __MINGW_NOTHROW
-__JMPSTUB__(( FUNCTION = vsnwprintf, REMAPPED = _vsnwprintf ))
+__JMPSTUB__(( FUNCTION = vsnwprintf, DLLENTRY = _vsnwprintf ))
int vsnwprintf (wchar_t *__s, size_t __n, const wchar_t *__fmt, __VALIST __arg)
{ return _vsnwprintf ( __s, __n, __fmt, __arg); }
#endif
* $Id$
*
* Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2013, 2014, MinGW.org Project
+ * Copyright (C) 2013, 2014, 2017, MinGW.org Project
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* an additional "-D REMAPPED=entryname" option, resulting in redirection
* of "funcname()" calls to the "entryname()" function entry point.
*
+ * Alternatively, calls to "funcname()" may be redirected to a DLL entry point,
+ * via its importable name within the DLL's export table, by specification of
+ * the "-D DLLENTRY=entryname" option, instead of "-D REMAPPED=entryname".
+ *
*/
#define __entry__(__suffix__) __label__(_,__suffix__)
#define __label__(__prefix__,__suffix__) __prefix__##__suffix__
-#ifndef REMAPPED
-# define __mingw__(__suffix__) __label__(__mingw_,__suffix__)
-# define REMAPPED __mingw__(FUNCTION)
+#if defined LLENTRY && ! defined DLLENTRY
+/* This is a convenience for users; it allows specification of a DLLENTRY
+ * option as simply "-DLLENTRY=entryname", as an alternative to specifying
+ * it fully, as "-D DLLENTRY=entryname".
+ */
+#define DLLENTRY LLENTRY
#endif
.text
+#ifdef DLLENTRY
+ /* This represents the case of redirection to a function implementation
+ * residing within a DLL...
+ */
+# define __dllentry__(__suffix__) __label__(__imp__,__suffix__)
+# define __redirect__ *__dllentry__(DLLENTRY)
+
+#else
+ /* ...whereas this redirection to an alternative static library function,
+ * or to a DLL implementation accessed via an import library trampoline.
+ */
+# ifndef REMAPPED
+ /* No explicit entry point redirection specified; use the default entry
+ * point name, within the "__mingw_" pseudo-namespace.
+ */
+# define __mingw__(__suffix__) __label__(__mingw_,__suffix__)
+# define REMAPPED __mingw__(FUNCTION)
+# endif
+# define __redirect__ __entry__(REMAPPED)
+.def __entry__(REMAPPED); .scl 2; .type 32; .endef
+#endif
+
.global __entry__(FUNCTION)
.def __entry__(FUNCTION); .scl 2; .type 32; .endef
-.def __entry__(REMAPPED); .scl 2; .type 32; .endef
-__entry__(FUNCTION): jmp __entry__(REMAPPED)
+__entry__(FUNCTION): jmp __redirect__
/* $RCSfile$: end of file */
+++ /dev/null
-#include <stdarg.h>
-#include <wchar.h>
-
-int snwprintf(wchar_t* buffer, size_t n, const wchar_t* format, ...)
-{
- int retval;
- va_list argptr;
-
- va_start( argptr, format );
- retval = _vsnwprintf( buffer, n, format, argptr );
- va_end( argptr );
- return retval;
-}
+++ /dev/null
-#include <stdarg.h>
-#include <wchar.h>
-
-int vsnwprintf(wchar_t *buffer, size_t n, const wchar_t * format, va_list argptr)
- { return _vsnwprintf( buffer, n, format, argptr );}