Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2003-04-01 02:32:20 +0400
committerDanny Smith <dannysmith@users.sourceforge.net>2003-04-01 02:32:20 +0400
commit7a3a79d89d68106e8abfdcefc200aa1487a8534e (patch)
tree17ef6f8f42176b463c0de6ca6721fa3a6d2abe90
parenta7fc6a897604e47434323312cd0ea96d6b0ce83d (diff)
Merge from mingw trunk (changes since 2003-01-27).
-rw-r--r--winsup/mingw/ChangeLog176
-rw-r--r--winsup/mingw/Makefile.in89
-rw-r--r--winsup/mingw/include/_mingw.h29
-rw-r--r--winsup/mingw/include/assert.h2
-rw-r--r--winsup/mingw/include/conio.h29
-rw-r--r--winsup/mingw/include/ctype.h149
-rw-r--r--winsup/mingw/include/direct.h20
-rw-r--r--winsup/mingw/include/dirent.h24
-rw-r--r--winsup/mingw/include/dos.h2
-rw-r--r--winsup/mingw/include/errno.h2
-rw-r--r--winsup/mingw/include/fenv.h22
-rw-r--r--winsup/mingw/include/float.h30
-rw-r--r--winsup/mingw/include/inttypes.h18
-rw-r--r--winsup/mingw/include/io.h144
-rw-r--r--winsup/mingw/include/locale.h15
-rw-r--r--winsup/mingw/include/malloc.h18
-rw-r--r--winsup/mingw/include/math.h398
-rw-r--r--winsup/mingw/include/mbctype.h30
-rw-r--r--winsup/mingw/include/mbstring.h146
-rw-r--r--winsup/mingw/include/process.h92
-rw-r--r--winsup/mingw/include/setjmp.h4
-rw-r--r--winsup/mingw/include/signal.h4
-rw-r--r--winsup/mingw/include/stddef.h2
-rw-r--r--winsup/mingw/include/stdio.h223
-rw-r--r--winsup/mingw/include/stdlib.h224
-rw-r--r--winsup/mingw/include/string.h184
-rw-r--r--winsup/mingw/include/sys/param.h3
-rw-r--r--winsup/mingw/include/sys/stat.h20
-rw-r--r--winsup/mingw/include/sys/timeb.h4
-rw-r--r--winsup/mingw/include/sys/utime.h8
-rw-r--r--winsup/mingw/include/time.h54
-rw-r--r--winsup/mingw/include/unistd.h8
-rw-r--r--winsup/mingw/include/wchar.h245
-rw-r--r--winsup/mingw/include/wctype.h73
-rw-r--r--winsup/mingw/mingwex/Makefile.in35
-rw-r--r--winsup/mingw/mingwex/dirent.c2
-rw-r--r--winsup/mingw/mingwex/fesetenv.c1
-rw-r--r--winsup/mingw/mingwex/math/cephes_emath.h1
-rw-r--r--winsup/mingw/mingwex/math/powl.c13
-rw-r--r--winsup/mingw/mingwex/math/tanhl.c4
-rw-r--r--winsup/mingw/mingwex/math/tgammal.c6
-rw-r--r--winsup/mingw/mingwex/snprintf.c13
-rw-r--r--winsup/mingw/mingwex/snwprintf.c13
-rw-r--r--winsup/mingw/mingwex/stdio/vwscanf.c1
-rw-r--r--winsup/mingw/mingwex/strtoimax.c2
-rw-r--r--winsup/mingw/mingwex/vsnprintf.c5
-rw-r--r--winsup/mingw/mingwex/vsnwprintf.c5
-rw-r--r--winsup/mingw/mingwex/wcstoimax.c2
-rw-r--r--winsup/mingw/mingwex/wtoll.c2
-rw-r--r--winsup/mingw/moldname-crtdll.def151
-rw-r--r--winsup/mingw/moldname-msvcrt.def151
-rw-r--r--winsup/mingw/moldname.def137
-rw-r--r--winsup/mingw/msvcrt.def737
-rw-r--r--winsup/mingw/msvcrt20.def719
-rw-r--r--winsup/mingw/msvcrt40.def676
-rw-r--r--winsup/mingw/profile/Makefile.in8
-rw-r--r--winsup/mingw/profile/profile.h8
-rw-r--r--winsup/mingw/samples/dlltest/dll.def1
-rw-r--r--winsup/mingw/samples/dlltest/expexe.def1
-rw-r--r--winsup/mingw/test_headers.c2
60 files changed, 1424 insertions, 3763 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index cfbb0d4c5..3528cc45b 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,177 @@
+2003-04-01 Danny Smith <dannysmith@users.sourceforge.net>
+
+ Merge from mingw trunk (changes since 2003-01-27).
+
+ 2003-04-01 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/_mingw.h (_CRTIMP): Make conditional on __USE_CRTIMP.
+
+ 2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * mingwex/dirent.c (_topendir): Eliminate signed/unsigned warning.
+ * mingwex/strtoimax.c (strtoimax): Likewise.
+ * mingwex/wcstoimax.c (wcstoimax): Likewise.
+ * mingwex/wtoll.c (wtoll): Remove unnecessary ';'
+ * mingwex/fesentenv.c: Include float.h.
+ * mingwex/math/powl.c: Eliminate type punning/strict aliasing
+ warning.
+ * mingwex/math/tanhl.c: Eliminate signed/unsigned warning in
+ constants.
+ * mingwex/math/tgammal.c: Likewise.
+
+ 2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/utime.h: New file, forwarding to sys/utime.h.
+
+ 2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/sys/param.h (MAXPATHLEN): Define.
+
+ 2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/tchar.h: Ansi-fy a comment.
+
+ 2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * profile/profile.h (mcount): Use __builtin_return_address
+ rather than inline __asm statements.
+ * profile/Makefile.in: Specify dependencies for mcount.o
+ profil.o gmon.o.
+
+ 2003-03-10 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/stdlib.h (qsort): Remove const from first parm.
+ Thanks to: Tien-Ren Chen <trchen@sourceforge.users.net>
+
+ 2003-03-03 Christopher Faylor <cgf@redhat.com>
+
+ * mingwex/getopt.c: Refresh from NetBSD sources.
+
+ 2003-03-03 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * mingwex/getopt.c: New file, copied from cygwin srcs.
+ * include/getopt.h: New file, copied from cygwin srcs.
+ * include/unistd.h: Include getopt.h.
+ * mingwex/Makefile.in (DISTFILES): Add getopt.c.
+ (POSIX_OBJS): Add getopt.o.
+
+ 2003-03-02 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/stdio.h (vscanf): Add prototype.
+ (vfscanf): Ditto.
+ (vsscanf): Ditto.
+ (vwscanf): Ditto.
+ (vfwscanf): Ditto.
+ (vswscanf): Ditto.
+ * include/wchar.h (vwscanf): Add prototype.
+ (vfwscanf): Ditto.
+ (vswscanf): Ditto.
+ * mingwex/snprintf.c: Move to mingwex/stdio.
+ * mingwex/vsnprintf.c: Ditto.
+ * mingwex/snwprintf.c: Ditto.
+ * mingwex/vsnwprintf.c: Ditto.
+ * mingwex/Makefile.in (VPATH): Add $(srcdir)/stdio
+ (STDIO_DISTFILES): Add.
+ (DISTFILES): Adjust.
+ (STDIO_STUB_OBJS): Rename to STDIO_OBJS and add v*scanf objects.
+ (LIB_OBJS): Adjust.
+ (dist): Adjust.
+
+ 2003-03-02 Aaron W LaFramboise <AWLaFramboise@aol.com>
+
+ * mingwex/stdio: New directory
+ * mingwex/stdio/vfscanf.c: New file.
+ * mingwex/stdio/vfwscanf.c: New file.
+ * mingwex/stdio/vscanf.c: New file.
+ * mingwex/stdio/vsscanf.c: New file.
+ * mingwex/stdio/vswscanf.c: New file.
+ * mingwex/stdio/vwscanf.c: New file.
+
+ 2003-02-25 Earnie Boyd <earnie@users.sf.net>
+
+ * Makefile.in (libmsvcrt20.a): Remove target and dependencies.
+ (libmsvcrt40.a): Ditto.
+
+ 2003-02-21 Earnie Boyd <earnie@users.sf.net>
+
+ Thanks to David Frasier <davidf@sjsoft.com> who inspired portions of
+ this patch.
+ * Makefile.in (libmsvcrtd.a): Add target library.
+ (libmoldnamed.a): Ditto.
+ (msvcrt.def, msvcrtd.def, msvcrt20.def, msvcrt40.def): Use msvcrt.def.in
+ template to create.
+ ($(srcdir)): Remove explicit reference for depencies of object targets.
+ * moldname.def, moldname-msvcrt.def, moldname-crtdll.def, msvcrt.def,
+ msvcrt20.def, msvcrt40.def: Remove.
+ * msvcrt.def.in: New file (Copy of previous msvcrt.def).
+
+ 2003-02-20 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in: Make sure libmingwex.a from current build tree is used.
+
+ 2003-02-10 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/math.h: Remove _CRTIMP from pow() prototype,
+ unless __NO_ISOCEXT.
+
+ 2003-02-10 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * mingwex/math/cephes_emath.h: Don't redefine INFINITY.
+
+ 2003-02-10 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/_mingw.h (_CRTIMP): Define for __GNUC__ if
+ __declspec(dllimport) supported.
+ (__cdecl): Define if not already defined.
+ (__stdcall): Likewise.
+ * include/dirent.h: Qualify fuctions with __cdecl.
+ * include/fenv.h: Likewise.
+ * include/inttypes.h: Likewise.
+ * include/assert.h: Qualify fuctions with __cdecl. Qualify
+ CRT dll imports with _CRTIMP.
+ * include/conio.h: Likewise.
+ * include/ctype.h: Likewise.
+ * include/direct.h: Likewise.
+ * include/dos.h: Likewise.
+ * include/errno.h: Likewise.
+ * include/float.h: Likewise.
+ * include/io.h: Likewise.
+ * include/locale.h: Likewise.
+ * include/malloc.h: Likewise.
+ * include/math.h: Likewise.
+ * include/mbctype.h: Likewise.
+ * include/mbstring.h: Likewise.
+ * include/process.h: Likewise.
+ * include/setjmp.h: Likewise.
+ * include/signal.h: Likewise.
+ * include/stdio.h: Likewise.
+ * include/stdlib.h: Likewise.
+ * include/string.h: Likewise.
+ * include/time.h: Likewise.
+ * include/wchar.h: Likewise.
+ * include/wctype.h: Likewise.
+ * include/sys/stat.h: Likewise.
+ * include/sys/timeb.h: Likewise.
+ * include/sys/utime.h: Likewise.
+
+ * include/ctype.h: Guard ctype inlines with __NO_INLINE__.
+ * include/wctype.h: Guard wctype inlines with __NO_INLINE__.
+
+ * include/stdio.h (__VALIST): Guard against prior definition.
+
+ 2003-02-08 Earnie Boyd <earnie@users.sf.net>
+
+ * include/_mingw.h: Change version to 3.0
+ * Makefile.in: Ditto.
+
+ 2003-02-08 Earnie Boyd <earnie@users.sf.net>
+
+ * include/stdlib.h: Make words after #endif a comment.
+
+ 2003-02-07 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/locale.h: Include stddef.h for definition of NULL.
+
2003-01-27 Danny Smith <dannysmith@users.sourceforge.net>
* include/setjmp.h (_setjmp): Move from std to global
@@ -128,7 +302,7 @@
2002-10-30 Guido Serassio <serassio@libero.it>
- * include/stdio.h (_getmaxstdio): Add prototype.
+ * include/stdio.h (_getmaxstdio): Add prototype.
(_setmaxstdio): Likewise.
2002-10-19 Kang Li <rubylith@users.sourceforge.net>
diff --git a/winsup/mingw/Makefile.in b/winsup/mingw/Makefile.in
index 5b3a0f960..478e7b699 100644
--- a/winsup/mingw/Makefile.in
+++ b/winsup/mingw/Makefile.in
@@ -18,7 +18,7 @@
# This makefile requires GNU make.
PACKAGE = mingw-runtime
-VERSION = 2.4
+VERSION = 3.0
CYGRELEASE = 1
VPATH = @srcdir@
@@ -154,17 +154,17 @@ MINGW_OBJS = CRTglob.o CRTfmode.o CRTinit.o dllmain.o gccmain.o \
pseudo-reloc.o pseudo-reloc-list.o
MOLD_OBJS = ctype_old.o string_old.o
-LIBS = libcrtdll.a libmsvcrt.a libmsvcrt20.a libmsvcrt40.a libmingw32.a \
- libcoldname.a libmoldname.a $(LIBM_A) libmingwthrd.a
+LIBS = libcrtdll.a libmsvcrt.a libmsvcrtd.a libmingw32.a \
+ libcoldname.a libmoldname.a libmoldnamed.a $(LIBM_A) libmingwthrd.a
DLLS = $(THREAD_DLL_NAME)
SRCDIST_FILES = CRT_noglob.c CRTfmode.c CRTglob.c CRTinit.c ChangeLog \
Makefile.in README TODO config.guess config.sub configure configure.in \
crt1.c crtdll.def crtmt.c crtst.c ctype_old.c dllcrt1.c dllmain.c \
-gccmain.c init.c install-sh jamfile main.c mkinstalldirs moldname-crtdll.def \
-moldname-msvcrt.def moldname.def moldname.def.in msvcrt.def msvcrt20.def \
-msvcrt40.def mthr.c mthr_init.c mthr_stub.c readme.txt string_old.c \
+gccmain.c init.c install-sh jamfile main.c mkinstalldirs \
+moldname.def.in msvcrt.def.in \
+mthr.c mthr_init.c mthr_stub.c readme.txt string_old.c \
CRT_fp8.c CRT_fp10.c test_headers.c txtmode.c binmode.c pseudo-reloc.c \
pseudo-reloc-list.c
@@ -207,12 +207,13 @@ xx_$(THREAD_DLL_NAME) xx_mingwthrd.def: mthr.o mthr_init.o
DLL_OFILES = mthr.o mthr_init.o
DLL_CC_STUFF = -B./ -mdll $(MNO_CYGWIN) -Wl,--image-base,0x6FBC0000 \
-Wl,--entry,_DllMainCRTStartup@12 \
- $(DLL_OFILES)
+ $(DLL_OFILES) \
+ -Lmingwex
DLL_DLLTOOL_STUFF = --as=$(AS) --dllname $(THREAD_DLL_NAME) \
--def mingwthrd.def \
--base-file mingwthrd.base --output-exp mingwthrd.exp
-$(THREAD_DLL_NAME) mingwthrd.def: $(DLL_OFILES) Makefile
+$(THREAD_DLL_NAME) mingwthrd.def: $(DLL_OFILES) Makefile $(SUBDIRS)
$(DLLTOOL) --as $(AS) --output-def mingwthrd.def $(DLL_OFILES)
$(CC) -Wl,--base-file=mingwthrd.base $(DLL_CC_STUFF) \
-o mingwthrd_dummy.exe
@@ -227,30 +228,44 @@ libmingw32.a: $(MINGW_OBJS)
$(AR) rc $@ $(MINGW_OBJS)
$(RANLIB) $@
-$(srcdir)/moldname-crtdll.def: moldname.def.in
+msvcrt.def msvcrtd.def: msvcrt.def.in
+ $(CC) -DRUNTIME=$(basename $(notdir $@)) \
+ -D__FILENAME__=$@ \
+ -D__MSVCRT__ -C -E -P \
+ -xc-header $? > $@
+
+moldname-crtdll.def: moldname.def.in
$(CC) -DRUNTIME=crtdll \
-D__FILENAME__=moldname-crtdll.def \
-D__CRTDLL__ -C -E -P \
-xc-header $? > $@
-$(srcdir)/moldname-msvcrt.def: moldname.def.in
+moldname-msvcrt.def: moldname.def.in
$(CC) -DRUNTIME=msvcrt \
-D__FILENAME__=moldname-msvcrt.def \
-D__MSVCRT__ -C -E -P \
-xc-header $? > $@
-libcoldname.a: $(srcdir)/moldname-crtdll.def $(MOLD_OBJS)
+libcoldname.a: moldname-crtdll.def $(MOLD_OBJS)
$(DLLTOOL) --as $(AS) -k -U \
--dllname crtdll.dll \
- --def $(srcdir)/moldname-crtdll.def \
+ --def moldname-crtdll.def \
--output-lib $@
$(AR) rc $@ $(MOLD_OBJS)
$(RANLIB) $@
-libmoldname.a: $(srcdir)/moldname-msvcrt.def $(MOLD_OBJS)
+libmoldname.a: moldname-msvcrt.def $(MOLD_OBJS)
$(DLLTOOL) --as $(AS) -k -U \
--dllname msvcrt.dll \
- --def $(srcdir)/moldname-msvcrt.def \
+ --def moldname-msvcrt.def \
+ --output-lib $@
+ $(AR) rc $@ $(MOLD_OBJS)
+ $(RANLIB) $@
+
+libmoldnamed.a: moldname-msvcrt.def $(MOLD_OBJS)
+ $(DLLTOOL) --as $(AS) -k -U \
+ --dllname msvcrtd.dll \
+ --def moldname-msvcrt.def \
--output-lib $@
$(AR) rc $@ $(MOLD_OBJS)
$(RANLIB) $@
@@ -285,12 +300,11 @@ test_headers:
clean:
-rm -f *.o *.a *~ core a.out mingwthrd.def mingwthrd.base mingwthrd.exp
-rm -f $(THREAD_DLL_NAME) mingwthrd_dummy.exe
+ -rm -f moldname-*.def
@$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS)
-distclean:
+distclean: clean
@$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS)
- -rm -f *.o *.a *~ core a.out mingwthrd.def mingwthrd.base mingwthrd.exp
- -rm -f $(THREAD_DLL_NAME)
-rm -f config.cache config.status config.log
-rm -f Makefile
@@ -396,27 +410,26 @@ force:
#
# Dependancies
#
-libcrtdll.a: $(srcdir)/crtdll.def
-libmsvcrt.a: $(srcdir)/msvcrt.def
-libmsvcrt20.a: $(srcdir)/msvcrt20.def
-libmsvcrt40.a: $(srcdir)/msvcrt40.def
-CRT_noglob.o: $(srcdir)/CRT_noglob.c
-CRTfmode.o: $(srcdir)/CRTfmode.c
-CRTglob.o: $(srcdir)/CRTglob.c
-CRTinit.o: $(srcdir)/CRTinit.c
-crt1.o: $(srcdir)/crt1.c $(srcdir)/init.c
-crt2.o: $(srcdir)/crt1.c $(srcdir)/init.c
-crtmt.o: $(srcdir)/crtmt.c
-crtst.o: $(srcdir)/crtst.c
-ctype_old.o: $(srcdir)/ctype_old.c
-dllcrt1.o: $(srcdir)/dllcrt1.c
-dllcrt2.o: $(srcdir)/dllcrt1.c
-dllmain.o: $(srcdir)/dllmain.c
-main.o: $(srcdir)/main.c
-oldnames.o: $(srcdir)/oldnames.c
-string_old.o: $(srcdir)/string_old.c
-CRT_fp8.o: $(srcdir)/CRT_fp8.c
-CRT_fp10.o: $(srcdir)/CRT_fp10.c
+libcrtdll.a: crtdll.def
+libmsvcrt.a: msvcrt.def
+libmsvcrtd.a: msvcrtd.def
+CRT_noglob.o: CRT_noglob.c
+CRTfmode.o: CRTfmode.c
+CRTglob.o: CRTglob.c
+CRTinit.o: CRTinit.c
+crt1.o: crt1.c init.c
+crt2.o: crt1.c init.c
+crtmt.o: crtmt.c
+crtst.o: crtst.c
+ctype_old.o: ctype_old.c
+dllcrt1.o: dllcrt1.c
+dllcrt2.o: dllcrt1.c
+dllmain.o: dllmain.c
+main.o: main.c
+oldnames.o: oldnames.c
+string_old.o: string_old.c
+CRT_fp8.o: CRT_fp8.c
+CRT_fp10.o: CRT_fp10.c
Makefile: Makefile.in config.status configure
diff --git a/winsup/mingw/include/_mingw.h b/winsup/mingw/include/_mingw.h
index 53a6a23f5..9af004452 100644
--- a/winsup/mingw/include/_mingw.h
+++ b/winsup/mingw/include/_mingw.h
@@ -29,6 +29,7 @@
__DECLSPEC_SUPPORTED Defined if dllimport attribute is supported.
__MINGW_IMPORT The attribute definition to specify imported
variables/functions.
+ _CRTIMP As above. For MS compatibility.
__MINGW32_VERSION Runtime version.
__MINGW32_MAJOR_VERSION Runtime major version.
__MINGW32_MINOR_VERSION Runtime minor version.
@@ -47,6 +48,9 @@
# ifndef __MINGW_IMPORT
# define __MINGW_IMPORT __declspec(dllimport)
# endif
+# ifndef _CRTIMP
+# define _CRTIMP __declspec(dllimport)
+# endif
# define __DECLSPEC_SUPPORTED
#else /* __GNUC__ */
# ifdef __declspec
@@ -55,19 +59,32 @@
/* Note the extern. This is needed to work around GCC's
limitations in handling dllimport attribute. */
# define __MINGW_IMPORT extern __attribute__((dllimport))
+# endif
+# ifndef _CRTIMP
+# ifdef __USE_CRTIMP
+# define _CRTIMP __attribute__((dllimport))
+# else
+# define _CRTIMP
# endif
+# endif
# define __DECLSPEC_SUPPORTED
# else /* __declspec */
# undef __DECLSPEC_SUPPORTED
# undef __MINGW_IMPORT
-# endif
+# endif /* __declspec */
+# ifndef __cdecl
+# define __cdecl __attribute__((cdecl))
+# endif
+# ifndef __stdcall
+# define __stdcall __attribute__((stdcall))
+# endif
# undef __int64
# define __int64 long long
#endif /* __GNUC__ */
-
-#define __MINGW32_VERSION 2.4
-#define __MINGW32_MAJOR_VERSION 2
-#define __MINGW32_MINOR_VERSION 4
+
+#define __MINGW32_VERSION 3.0
+#define __MINGW32_MAJOR_VERSION 3
+#define __MINGW32_MINOR_VERSION 0
/* ISO C++. */
#ifndef __HAVE_STD_CXX
@@ -106,6 +123,4 @@
# define __CGLOBAL
#endif
-
#endif /* __MINGW_H */
-
diff --git a/winsup/mingw/include/assert.h b/winsup/mingw/include/assert.h
index 07a7d1ffe..893db9113 100644
--- a/winsup/mingw/include/assert.h
+++ b/winsup/mingw/include/assert.h
@@ -49,7 +49,7 @@ extern "C" {
* CRTDLL nicely supplies a function which does the actual output and
* call to abort.
*/
-void _assert (const char*, const char*, int)
+_CRTIMP void __cdecl _assert (const char*, const char*, int)
#ifdef __GNUC__
__attribute__ ((noreturn))
#endif
diff --git a/winsup/mingw/include/conio.h b/winsup/mingw/include/conio.h
index 4e8d55ab6..780ccc10d 100644
--- a/winsup/mingw/include/conio.h
+++ b/winsup/mingw/include/conio.h
@@ -39,26 +39,25 @@
extern "C" {
#endif
+_CRTIMP char* __cdecl _cgets (char*);
+_CRTIMP int __cdecl _cprintf (const char*, ...);
+_CRTIMP int __cdecl _cputs (const char*);
+_CRTIMP int __cdecl _cscanf (char*, ...);
-char* _cgets (char*);
-int _cprintf (const char*, ...);
-int _cputs (const char*);
-int _cscanf (char*, ...);
-
-int _getch (void);
-int _getche (void);
-int _kbhit (void);
-int _putch (int);
-int _ungetch (int);
+_CRTIMP int __cdecl _getch (void);
+_CRTIMP int __cdecl _getche (void);
+_CRTIMP int __cdecl _kbhit (void);
+_CRTIMP int __cdecl _putch (int);
+_CRTIMP int __cdecl _ungetch (int);
#ifndef _NO_OLDNAMES
-int getch (void);
-int getche (void);
-int kbhit (void);
-int putch (int);
-int ungetch (int);
+_CRTIMP int __cdecl getch (void);
+_CRTIMP int __cdecl getche (void);
+_CRTIMP int __cdecl kbhit (void);
+_CRTIMP int __cdecl putch (int);
+_CRTIMP int __cdecl ungetch (int);
#endif /* Not _NO_OLDNAMES */
diff --git a/winsup/mingw/include/ctype.h b/winsup/mingw/include/ctype.h
index ae38c35ac..8828ba13c 100644
--- a/winsup/mingw/include/ctype.h
+++ b/winsup/mingw/include/ctype.h
@@ -57,22 +57,22 @@
__BEGIN_CSTD_NAMESPACE
-int isalnum(int);
-int isalpha(int);
-int iscntrl(int);
-int isdigit(int);
-int isgraph(int);
-int islower(int);
-int isprint(int);
-int ispunct(int);
-int isspace(int);
-int isupper(int);
-int isxdigit(int);
+_CRTIMP int __cdecl isalnum(int);
+_CRTIMP int __cdecl isalpha(int);
+_CRTIMP int __cdecl iscntrl(int);
+_CRTIMP int __cdecl isdigit(int);
+_CRTIMP int __cdecl isgraph(int);
+_CRTIMP int __cdecl islower(int);
+_CRTIMP int __cdecl isprint(int);
+_CRTIMP int __cdecl ispunct(int);
+_CRTIMP int __cdecl isspace(int);
+_CRTIMP int __cdecl isupper(int);
+_CRTIMP int __cdecl isxdigit(int);
/* These are the ANSI versions, with correct checking of argument */
-int tolower(int);
-int toupper(int);
+_CRTIMP int __cdecl tolower(int);
+_CRTIMP int __cdecl toupper(int);
/*
* NOTE: The above are not old name type wrappers, but functions exported
@@ -88,16 +88,16 @@ __BEGIN_CGLOBAL_NAMESPACE
* These are the cheap non-std versions: The return values are undefined
* if the argument is not ASCII char or is not of appropriate case
*/
-int _tolower(int);
-int _toupper(int);
+_CRTIMP int __cdecl _tolower(int);
+_CRTIMP int __cdecl _toupper(int);
#if !defined (__NO_CTYPE_INLINES)
/* these reproduce behaviour of lib underscored versions */
-extern __inline__ int _tolower(int __c) {return ( __c -'A'+'a');}
-extern __inline__ int _toupper(int __c) {return ( __c -'a'+'A');}
+extern __inline__ int __cdecl _tolower(int __c) {return ( __c -'A'+'a');}
+extern __inline__ int __cdecl _toupper(int __c) {return ( __c -'a'+'A');}
#endif
-int _isctype (int, int);
+_CRTIMP int __cdecl _isctype (int, int);
#endif /* __STRICT_ANSI__ */
@@ -162,21 +162,22 @@ extern unsigned short** _imp___ctype;
* optimise away the constant condition.
*/
-#if ! (defined (__NO_CTYPE_INLINES) || defined (__STRICT_ANSI__ ))
+#if ! (defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES) \
+ || defined (__STRICT_ANSI__ ))
/* use simple lookup if SB locale, else _isctype() */
#define __ISCTYPE(__c, __mask) \
(MB_CUR_MAX == 1 ? (_pctype[__c] & __mask) : __CGLOBAL _isctype(__c, __mask))
-extern __inline__ int isalnum(int __c) {return __ISCTYPE(__c, (_ALPHA|_DIGIT));}
-extern __inline__ int isalpha(int __c) {return __ISCTYPE(__c, _ALPHA);}
-extern __inline__ int iscntrl(int __c) {return __ISCTYPE(__c, _CONTROL);}
-extern __inline__ int isdigit(int __c) {return __ISCTYPE(__c, _DIGIT);}
-extern __inline__ int isgraph(int __c) {return __ISCTYPE(__c, (_PUNCT|_ALPHA|_DIGIT));}
-extern __inline__ int islower(int __c) {return __ISCTYPE(__c, _LOWER);}
-extern __inline__ int isprint(int __c) {return __ISCTYPE(__c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));}
-extern __inline__ int ispunct(int __c) {return __ISCTYPE(__c, _PUNCT);}
-extern __inline__ int isspace(int __c) {return __ISCTYPE(__c, _SPACE);}
-extern __inline__ int isupper(int __c) {return __ISCTYPE(__c, _UPPER);}
-extern __inline__ int isxdigit(int __c) {return __ISCTYPE(__c, _HEX);}
+extern __inline__ int __cdecl isalnum(int __c) {return __ISCTYPE(__c, (_ALPHA|_DIGIT));}
+extern __inline__ int __cdecl isalpha(int __c) {return __ISCTYPE(__c, _ALPHA);}
+extern __inline__ int __cdecl iscntrl(int __c) {return __ISCTYPE(__c, _CONTROL);}
+extern __inline__ int __cdecl isdigit(int __c) {return __ISCTYPE(__c, _DIGIT);}
+extern __inline__ int __cdecl isgraph(int __c) {return __ISCTYPE(__c, (_PUNCT|_ALPHA|_DIGIT));}
+extern __inline__ int __cdecl islower(int __c) {return __ISCTYPE(__c, _LOWER);}
+extern __inline__ int __cdecl isprint(int __c) {return __ISCTYPE(__c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));}
+extern __inline__ int __cdecl ispunct(int __c) {return __ISCTYPE(__c, _PUNCT);}
+extern __inline__ int __cdecl isspace(int __c) {return __ISCTYPE(__c, _SPACE);}
+extern __inline__ int __cdecl isupper(int __c) {return __ISCTYPE(__c, _UPPER);}
+extern __inline__ int __cdecl isxdigit(int __c) {return __ISCTYPE(__c, _HEX);}
/* TODO? Is it worth inlining ANSI tolower, toupper? Probably only
if we only want C-locale. */
@@ -195,40 +196,40 @@ typedef wchar_t wctype_t;
#define _WCTYPE_T_DEFINED
#endif
-int iswalnum(wint_t);
-int iswalpha(wint_t);
-int iswascii(wint_t);
-int iswcntrl(wint_t);
-int iswctype(wint_t, wctype_t);
-int iswdigit(wint_t);
-int iswgraph(wint_t);
-int iswlower(wint_t);
-int iswprint(wint_t);
-int iswpunct(wint_t);
-int iswspace(wint_t);
-int iswupper(wint_t);
-int iswxdigit(wint_t);
-
-wchar_t towlower(wchar_t);
-wchar_t towupper(wchar_t);
-
-int isleadbyte (int);
+_CRTIMP int __cdecl iswalnum(wint_t);
+_CRTIMP int __cdecl iswalpha(wint_t);
+_CRTIMP int __cdecl iswascii(wint_t);
+_CRTIMP int __cdecl iswcntrl(wint_t);
+_CRTIMP int __cdecl iswctype(wint_t, wctype_t);
+_CRTIMP int __cdecl iswdigit(wint_t);
+_CRTIMP int __cdecl iswgraph(wint_t);
+_CRTIMP int __cdecl iswlower(wint_t);
+_CRTIMP int __cdecl iswprint(wint_t);
+_CRTIMP int __cdecl iswpunct(wint_t);
+_CRTIMP int __cdecl iswspace(wint_t);
+_CRTIMP int __cdecl iswupper(wint_t);
+_CRTIMP int __cdecl iswxdigit(wint_t);
+
+_CRTIMP wchar_t __cdecl towlower(wchar_t);
+_CRTIMP wchar_t __cdecl towupper(wchar_t);
+
+_CRTIMP int __cdecl isleadbyte (int);
#if ! (defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
#define __WCTYPE_INLINES_DEFINED
-extern __inline__ int iswalnum(wint_t __wc) {return (iswctype(__wc,_ALPHA|_DIGIT));}
-extern __inline__ int iswalpha(wint_t __wc) {return (iswctype(__wc,_ALPHA));}
-extern __inline__ int iswascii(wint_t __wc) {return ((__wc & ~0x7F) == 0);}
-extern __inline__ int iswcntrl(wint_t __wc) {return (iswctype(__wc,_CONTROL));}
-extern __inline__ int iswdigit(wint_t __wc) {return (iswctype(__wc,_DIGIT));}
-extern __inline__ int iswgraph(wint_t __wc) {return (iswctype(__wc,_PUNCT|_ALPHA|_DIGIT));}
-extern __inline__ int iswlower(wint_t __wc) {return (iswctype(__wc,_LOWER));}
-extern __inline__ int iswprint(wint_t __wc) {return (iswctype(__wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
-extern __inline__ int iswpunct(wint_t __wc) {return (iswctype(__wc,_PUNCT));}
-extern __inline__ int iswspace(wint_t __wc) {return (iswctype(__wc,_SPACE));}
-extern __inline__ int iswupper(wint_t __wc) {return (iswctype(__wc,_UPPER));}
-extern __inline__ int iswxdigit(wint_t __wc) {return (iswctype(__wc,_HEX));}
-extern __inline__ int isleadbyte(int __c)
+extern __inline__ int __cdecl iswalnum(wint_t __wc) {return (iswctype(__wc,_ALPHA|_DIGIT));}
+extern __inline__ int __cdecl iswalpha(wint_t __wc) {return (iswctype(__wc,_ALPHA));}
+extern __inline__ int __cdecl iswascii(wint_t __wc) {return ((__wc & ~0x7F) == 0);}
+extern __inline__ int __cdecl iswcntrl(wint_t __wc) {return (iswctype(__wc,_CONTROL));}
+extern __inline__ int __cdecl iswdigit(wint_t __wc) {return (iswctype(__wc,_DIGIT));}
+extern __inline__ int __cdecl iswgraph(wint_t __wc) {return (iswctype(__wc,_PUNCT|_ALPHA|_DIGIT));}
+extern __inline__ int __cdecl iswlower(wint_t __wc) {return (iswctype(__wc,_LOWER));}
+extern __inline__ int __cdecl iswprint(wint_t __wc) {return (iswctype(__wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
+extern __inline__ int __cdecl iswpunct(wint_t __wc) {return (iswctype(__wc,_PUNCT));}
+extern __inline__ int __cdecl iswspace(wint_t __wc) {return (iswctype(__wc,_SPACE));}
+extern __inline__ int __cdecl iswupper(wint_t __wc) {return (iswctype(__wc,_UPPER));}
+extern __inline__ int __cdecl iswxdigit(wint_t __wc) {return (iswctype(__wc,_HEX));}
+extern __inline__ int __cdecl isleadbyte(int __c)
{return (_pctype[(unsigned char)(__c)] & _LEADBYTE);}
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
__END_CSTD_NAMESPACE
@@ -237,26 +238,26 @@ __END_CSTD_NAMESPACE
#ifndef __STRICT_ANSI__
__BEGIN_CGLOBAL_NAMESPACE
-int __isascii (int);
-int __toascii (int);
-int __iscsymf (int); /* Valid first character in C symbol */
-int __iscsym (int); /* Valid character in C symbol (after first) */
+_CRTIMP int __cdecl __isascii (int);
+_CRTIMP int __cdecl __toascii (int);
+_CRTIMP int __cdecl __iscsymf (int); /* Valid first character in C symbol */
+_CRTIMP int __cdecl __iscsym (int); /* Valid character in C symbol (after first) */
#ifndef __NO_CTYPE_INLINES
-extern __inline__ int __isascii(int __c) {return ((__c & ~0x7F) == 0);}
-extern __inline__ int __toascii(int __c) {return (__c & 0x7F);}
-extern __inline__ int __iscsymf(int __c) {return (__CSTD isalpha(__c) || (__c == '_'));}
-extern __inline__ int __iscsym(int __c) {return (__CSTD isalnum(__c) || (__c == '_'));}
+extern __inline__ int __cdecl __isascii(int __c) {return ((__c & ~0x7F) == 0);}
+extern __inline__ int __cdecl __toascii(int __c) {return (__c & 0x7F);}
+extern __inline__ int __cdecl __iscsymf(int __c) {return (__CSTD isalpha(__c) || (__c == '_'));}
+extern __inline__ int __cdecl __iscsym(int __c) {return (__CSTD isalnum(__c) || (__c == '_'));}
#endif /* __NO_CTYPE_INLINES */
#ifndef _NO_OLDNAMES
-int isascii (int);
-int toascii (int);
-int iscsymf (int);
-int iscsym (int);
+_CRTIMP int __cdecl isascii (int);
+_CRTIMP int __cdecl toascii (int);
+_CRTIMP int __cdecl iscsymf (int);
+_CRTIMP int __cdecl iscsym (int);
#endif /* Not _NO_OLDNAMES */
-int is_wctype(__CSTD wint_t, __CSTD wctype_t); /* Obsolete! */
+_CRTIMP int __cdecl is_wctype(__CSTD wint_t, __CSTD wctype_t); /* Obsolete! */
__END_CGLOBAL_NAMESPACE
#endif /* Not __STRICT_ANSI__ */
diff --git a/winsup/mingw/include/direct.h b/winsup/mingw/include/direct.h
index cbd8e9fe1..c8fec4cf4 100644
--- a/winsup/mingw/include/direct.h
+++ b/winsup/mingw/include/direct.h
@@ -61,11 +61,11 @@ struct _diskfree_t {
* You really shouldn't be using these. Use the Win32 API functions instead.
* However, it does make it easier to port older code.
*/
-int _getdrive (void);
-unsigned long _getdrives(void);
-int _chdrive (int);
-char* _getdcwd (int, char*, int);
-unsigned _getdiskfree (unsigned, struct _diskfree_t *);
+_CRTIMP int __cdecl _getdrive (void);
+_CRTIMP unsigned long __cdecl _getdrives(void);
+_CRTIMP int __cdecl _chdrive (int);
+_CRTIMP char* __cdecl _getdcwd (int, char*, int);
+_CRTIMP unsigned __cdecl _getdiskfree (unsigned, struct _diskfree_t *);
#ifndef _NO_OLDNAMES
# define diskfree_t _diskfree_t
@@ -74,11 +74,11 @@ unsigned _getdiskfree (unsigned, struct _diskfree_t *);
#ifndef _WDIRECT_DEFINED
/* wide character versions. Also in wchar.h */
#ifdef __MSVCRT__
-int _wchdir(const wchar_t*);
-wchar_t* _wgetcwd(wchar_t*, int);
-wchar_t* _wgetdcwd(int, wchar_t*, int);
-int _wmkdir(const wchar_t*);
-int _wrmdir(const wchar_t*);
+_CRTIMP int __cdecl _wchdir(const wchar_t*);
+_CRTIMP wchar_t* __cdecl _wgetcwd(wchar_t*, int);
+_CRTIMP wchar_t* __cdecl _wgetdcwd(int, wchar_t*, int);
+_CRTIMP int __cdecl _wmkdir(const wchar_t*);
+_CRTIMP int __cdecl _wrmdir(const wchar_t*);
#endif /* __MSVCRT__ */
#define _WDIRECT_DEFINED
#endif
diff --git a/winsup/mingw/include/dirent.h b/winsup/mingw/include/dirent.h
index 4df6bd997..5a9246a4a 100644
--- a/winsup/mingw/include/dirent.h
+++ b/winsup/mingw/include/dirent.h
@@ -77,12 +77,12 @@ typedef struct
char dd_name[1];
} DIR;
-DIR* opendir (const char*);
-struct dirent* readdir (DIR*);
-int closedir (DIR*);
-void rewinddir (DIR*);
-long telldir (DIR*);
-void seekdir (DIR*, long);
+DIR* __cdecl opendir (const char*);
+struct dirent* __cdecl readdir (DIR*);
+int __cdecl closedir (DIR*);
+void __cdecl rewinddir (DIR*);
+long __cdecl telldir (DIR*);
+void __cdecl seekdir (DIR*, long);
/* wide char versions */
@@ -127,12 +127,12 @@ typedef struct
-_WDIR* _wopendir (const wchar_t*);
-struct _wdirent* _wreaddir (_WDIR*);
-int _wclosedir (_WDIR*);
-void _wrewinddir (_WDIR*);
-long _wtelldir (_WDIR*);
-void _wseekdir (_WDIR*, long);
+_WDIR* __cdecl _wopendir (const wchar_t*);
+struct _wdirent* __cdecl _wreaddir (_WDIR*);
+int __cdecl _wclosedir (_WDIR*);
+void __cdecl _wrewinddir (_WDIR*);
+long __cdecl _wtelldir (_WDIR*);
+void __cdecl _wseekdir (_WDIR*, long);
#ifdef __cplusplus
diff --git a/winsup/mingw/include/dos.h b/winsup/mingw/include/dos.h
index 5374a7a52..4f2134e7e 100644
--- a/winsup/mingw/include/dos.h
+++ b/winsup/mingw/include/dos.h
@@ -92,7 +92,7 @@ struct _diskfree_t {
#define _DISKFREE_T_DEFINED
#endif
-unsigned _getdiskfree (unsigned, struct _diskfree_t *);
+_CRTIMP unsigned __cdecl _getdiskfree (unsigned, struct _diskfree_t *);
#ifndef _NO_OLDNAMES
# define diskfree_t _diskfree_t
diff --git a/winsup/mingw/include/errno.h b/winsup/mingw/include/errno.h
index fdeb8e375..e4669ccec 100644
--- a/winsup/mingw/include/errno.h
+++ b/winsup/mingw/include/errno.h
@@ -104,7 +104,7 @@ extern "C" {
#undef errno
extern int errno;
#else
-int* _errno(void);
+_CRTIMP int* __cdecl _errno(void);
#define errno (*_errno())
#endif
diff --git a/winsup/mingw/include/fenv.h b/winsup/mingw/include/fenv.h
index e27095ff8..43dfd338a 100644
--- a/winsup/mingw/include/fenv.h
+++ b/winsup/mingw/include/fenv.h
@@ -65,23 +65,23 @@ extern "C" {
/*TODO: Some of these could be inlined */
/* 7.6.2 Exception */
-extern int feclearexcept (int);
-extern int fegetexceptflag (fexcept_t * flagp, int excepts);
-extern int feraiseexcept (int excepts );
-extern int fesetexceptflag (const fexcept_t *, int);
-extern int fetestexcept (int excepts);
+extern int __cdecl feclearexcept (int);
+extern int __cdecl fegetexceptflag (fexcept_t * flagp, int excepts);
+extern int __cdecl feraiseexcept (int excepts );
+extern int __cdecl fesetexceptflag (const fexcept_t *, int);
+extern int __cdecl fetestexcept (int excepts);
/* 7.6.3 Rounding */
-extern int fegetround (void);
-extern int fesetround (int mode);
+extern int __cdecl fegetround (void);
+extern int __cdecl fesetround (int mode);
/* 7.6.4 Environment */
-extern int fegetenv (fenv_t * envp);
-extern int fesetenv (const fenv_t * );
-extern int feupdateenv (const fenv_t *);
-extern int feholdexcept (fenv_t *);
+extern int __cdecl fegetenv (fenv_t * envp);
+extern int __cdecl fesetenv (const fenv_t * );
+extern int __cdecl feupdateenv (const fenv_t *);
+extern int __cdecl feholdexcept (fenv_t *);
#ifdef __cplusplus
}
diff --git a/winsup/mingw/include/float.h b/winsup/mingw/include/float.h
index afcc280a9..1e3d4aa82 100644
--- a/winsup/mingw/include/float.h
+++ b/winsup/mingw/include/float.h
@@ -115,12 +115,12 @@ extern "C" {
/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
* i.e. change the bits in unMask to have the values they have in unNew,
* leaving other bits unchanged. */
-unsigned int _controlfp (unsigned int unNew, unsigned int unMask);
-unsigned int _control87 (unsigned int unNew, unsigned int unMask);
+_CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask);
+_CRTIMP unsigned int __cdecl _control87 (unsigned int unNew, unsigned int unMask);
-unsigned int _clearfp (void); /* Clear the FPU status word */
-unsigned int _statusfp (void); /* Report the FPU status word */
+_CRTIMP unsigned int __cdecl _clearfp (void); /* Clear the FPU status word */
+_CRTIMP unsigned int __cdecl _statusfp (void); /* Report the FPU status word */
#define _clear87 _clearfp
#define _status87 _statusfp
@@ -134,11 +134,11 @@ unsigned int _statusfp (void); /* Report the FPU status word */
per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when
building your application.
*/
-void _fpreset (void);
-void fpreset (void);
+void __cdecl _fpreset (void);
+void __cdecl fpreset (void);
/* Global 'variable' for the current floating point error code. */
-int * __fpecode(void);
+_CRTIMP int * __cdecl __fpecode(void);
#define _fpecode (*(__fpecode()))
/*
@@ -146,15 +146,15 @@ int * __fpecode(void);
* but they really belong in math.h.
*/
-double _chgsign (double);
-double _copysign (double, double);
-double _logb (double);
-double _nextafter (double, double);
-double _scalb (double, long);
+_CRTIMP double __cdecl _chgsign (double);
+_CRTIMP double __cdecl _copysign (double, double);
+_CRTIMP double __cdecl _logb (double);
+_CRTIMP double __cdecl _nextafter (double, double);
+_CRTIMP double __cdecl _scalb (double, long);
-int _finite (double);
-int _fpclass (double);
-int _isnan (double);
+_CRTIMP int __cdecl _finite (double);
+_CRTIMP int __cdecl _fpclass (double);
+_CRTIMP int __cdecl _isnan (double);
#ifdef __cplusplus
}
diff --git a/winsup/mingw/include/inttypes.h b/winsup/mingw/include/inttypes.h
index f5b4d7813..31bfd4d20 100644
--- a/winsup/mingw/include/inttypes.h
+++ b/winsup/mingw/include/inttypes.h
@@ -254,19 +254,21 @@ typedef struct {
#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
-extern __inline__ intmax_t imaxabs (intmax_t __j)
+extern __inline__ intmax_t __cdecl imaxabs (intmax_t __j)
{return (__j >= 0 ? __j : -__j);}
-imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom);
+imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom);
/* 7.8.2 Conversion functions for greatest-width integer types */
-intmax_t strtoimax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);
-uintmax_t strtoumax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);
+intmax_t __cdecl strtoimax (const char* __restrict__ nptr,
+ char** __restrict__ endptr, int base);
+uintmax_t __cdecl strtoumax (const char* __restrict__ nptr,
+ char** __restrict__ endptr, int base);
-intmax_t wcstoimax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,
- int base);
-uintmax_t wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,
- int base);
+intmax_t __cdecl wcstoimax (const wchar_t* __restrict__ nptr,
+ wchar_t** __restrict__ endptr, int base);
+uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr,
+ wchar_t** __restrict__ endptr, int base);
#ifdef __cplusplus
}
diff --git a/winsup/mingw/include/io.h b/winsup/mingw/include/io.h
index ab12c7c1e..321f4d7ae 100644
--- a/winsup/mingw/include/io.h
+++ b/winsup/mingw/include/io.h
@@ -126,52 +126,52 @@ struct _wfinddatai64_t {
* _findclose calls. _findnext also returns -1 if no match could be found,
* and 0 if a match was found. Call _findclose when you are finished.
*/
-int _findfirst (const char*, struct _finddata_t*);
-int _findnext (int, struct _finddata_t*);
-int _findclose (int);
+_CRTIMP int __cdecl _findfirst (const char*, struct _finddata_t*);
+_CRTIMP int __cdecl _findnext (int, struct _finddata_t*);
+_CRTIMP int __cdecl _findclose (int);
-int _chdir (const char*);
-char* _getcwd (char*, int);
-int _mkdir (const char*);
-char* _mktemp (char*);
-int _rmdir (const char*);
-int _chmod (const char*, int);
+_CRTIMP int __cdecl _chdir (const char*);
+_CRTIMP char* __cdecl _getcwd (char*, int);
+_CRTIMP int __cdecl _mkdir (const char*);
+_CRTIMP char* __cdecl _mktemp (char*);
+_CRTIMP int __cdecl _rmdir (const char*);
+_CRTIMP int __cdecl _chmod (const char*, int);
#ifdef __MSVCRT__
-__int64 _filelengthi64(int);
-long _findfirsti64(const char*, struct _finddatai64_t*);
-int _findnexti64(long, struct _finddatai64_t*);
-__int64 _lseeki64(int, __int64, int);
-__int64 _telli64(int);
+_CRTIMP __int64 __cdecl _filelengthi64(int);
+_CRTIMP long __cdecl _findfirsti64(const char*, struct _finddatai64_t*);
+_CRTIMP int __cdecl _findnexti64(long, struct _finddatai64_t*);
+_CRTIMP __int64 __cdecl _lseeki64(int, __int64, int);
+_CRTIMP __int64 __cdecl _telli64(int);
#endif /* __MSVCRT__ */
#ifndef _NO_OLDNAMES
#ifndef _UWIN
-int chdir (const char*);
-char* getcwd (char*, int);
-int mkdir (const char*);
-char* mktemp (char*);
-int rmdir (const char*);
-int chmod (const char*, int);
+_CRTIMP int __cdecl chdir (const char*);
+_CRTIMP char* __cdecl getcwd (char*, int);
+_CRTIMP int __cdecl mkdir (const char*);
+_CRTIMP char* __cdecl mktemp (char*);
+_CRTIMP int __cdecl rmdir (const char*);
+_CRTIMP int __cdecl chmod (const char*, int);
#endif /* _UWIN */
#endif /* Not _NO_OLDNAMES */
-int _access (const char*, int);
-int _chsize (int, long);
-int _close (int);
-int _commit(int);
+_CRTIMP int __cdecl _access (const char*, int);
+_CRTIMP int __cdecl _chsize (int, long);
+_CRTIMP int __cdecl _close (int);
+_CRTIMP int __cdecl _commit(int);
/* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80),
* the "owner write permission" bit (on FAT). */
-int _creat (const char*, int);
+_CRTIMP int __cdecl _creat (const char*, int);
-int _dup (int);
-int _dup2 (int, int);
-long _filelength (int);
-long _get_osfhandle (int);
-int _isatty (int);
+_CRTIMP int __cdecl _dup (int);
+_CRTIMP int __cdecl _dup2 (int, int);
+_CRTIMP long _cdecl _filelength (int);
+_CRTIMP long _cdecl _get_osfhandle (int);
+_CRTIMP int __cdecl _isatty (int);
/* In a very odd turn of events this function is excluded from those
* files which define _STREAM_COMPAT. This is required in order to
@@ -179,31 +179,31 @@ int _isatty (int);
* line 107. Actually I might just be able to change the name of
* the enum member in streambuf.h... we'll see. TODO */
#ifndef _STREAM_COMPAT
-int _eof (int);
+_CRTIMP int __cdecl _eof (int);
#endif
/* LK_... locking commands defined in sys/locking.h. */
-int _locking (int, int, long);
+_CRTIMP int __cdecl _locking (int, int, long);
-long _lseek (int, long, int);
+_CRTIMP long _cdecl _lseek (int, long, int);
/* Optional third argument is unsigned unPermissions. */
-int _open (const char*, int, ...);
+_CRTIMP int __cdecl _open (const char*, int, ...);
-int _open_osfhandle (long, int);
-int _pipe (int *, unsigned int, int);
-int _read (int, void*, unsigned int);
-int _setmode (int, int);
+_CRTIMP int __cdecl _open_osfhandle (long, int);
+_CRTIMP int __cdecl _pipe (int *, unsigned int, int);
+_CRTIMP int __cdecl _read (int, void*, unsigned int);
+_CRTIMP int __cdecl _setmode (int, int);
/* SH_... flags for nShFlags defined in share.h
* Optional fourth argument is unsigned unPermissions */
-int _sopen (const char*, int, int, ...);
+_CRTIMP int __cdecl _sopen (const char*, int, int, ...);
-long _tell (int);
+_CRTIMP long _cdecl _tell (int);
/* Should umask be in sys/stat.h and/or sys/types.h instead? */
-int _umask (int);
-int _unlink (const char*);
-int _write (int, const void*, unsigned int);
+_CRTIMP int __cdecl _umask (int);
+_CRTIMP int __cdecl _unlink (const char*);
+_CRTIMP int __cdecl _write (int, const void*, unsigned int);
#ifndef _NO_OLDNAMES
/*
@@ -212,24 +212,24 @@ int _write (int, const void*, unsigned int);
*/
#ifndef _UWIN
-int access (const char*, int);
-int chsize (int, long );
-int close (int);
-int creat (const char*, int);
-int dup (int);
-int dup2 (int, int);
-int eof (int);
-long filelength (int);
-int isatty (int);
-long lseek (int, long, int);
-int open (const char*, int, ...);
-int read (int, void*, unsigned int);
-int setmode (int, int);
-int sopen (const char*, int, int, ...);
-long tell (int);
-int umask (int);
-int unlink (const char*);
-int write (int, const void*, unsigned int);
+_CRTIMP int __cdecl access (const char*, int);
+_CRTIMP int __cdecl chsize (int, long );
+_CRTIMP int __cdecl close (int);
+_CRTIMP int __cdecl creat (const char*, int);
+_CRTIMP int __cdecl dup (int);
+_CRTIMP int __cdecl dup2 (int, int);
+_CRTIMP int __cdecl eof (int);
+_CRTIMP long _cdecl filelength (int);
+_CRTIMP int __cdecl isatty (int);
+_CRTIMP long _cdecl lseek (int, long, int);
+_CRTIMP int __cdecl open (const char*, int, ...);
+_CRTIMP int __cdecl read (int, void*, unsigned int);
+_CRTIMP int __cdecl setmode (int, int);
+_CRTIMP int __cdecl sopen (const char*, int, int, ...);
+_CRTIMP long _cdecl tell (int);
+_CRTIMP int __cdecl umask (int);
+_CRTIMP int __cdecl unlink (const char*);
+_CRTIMP int __cdecl write (int, const void*, unsigned int);
#endif /* _UWIN */
#endif /* Not _NO_OLDNAMES */
@@ -237,17 +237,17 @@ int write (int, const void*, unsigned int);
/* Not in crtdll.dll */
#if !defined (_WIO_DEFINED)
#if defined (__MSVCRT__)
-int _waccess(const wchar_t*, int);
-int _wchmod(const wchar_t*, int);
-int _wcreat(const wchar_t*, int);
-long _wfindfirst(const wchar_t*, struct _wfinddata_t*);
-int _wfindnext(long, struct _wfinddata_t *);
-int _wunlink(const wchar_t*);
-int _wopen(const wchar_t*, int, ...);
-int _wsopen(const wchar_t*, int, int, ...);
-wchar_t * _wmktemp(wchar_t*);
-long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
-int _wfindnexti64(long, struct _wfinddatai64_t*);
+_CRTIMP int __cdecl _waccess(const wchar_t*, int);
+_CRTIMP int __cdecl _wchmod(const wchar_t*, int);
+_CRTIMP int __cdecl _wcreat(const wchar_t*, int);
+_CRTIMP long _cdecl _wfindfirst(const wchar_t*, struct _wfinddata_t*);
+_CRTIMP int __cdecl _wfindnext(long, struct _wfinddata_t *);
+_CRTIMP int __cdecl _wunlink(const wchar_t*);
+_CRTIMP int __cdecl _wopen(const wchar_t*, int, ...);
+_CRTIMP int __cdecl _wsopen(const wchar_t*, int, int, ...);
+_CRTIMP wchar_t * __cdecl _wmktemp(wchar_t*);
+_CRTIMP long __cdecl _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
+_CRTIMP int __cdecl _wfindnexti64(long, struct _wfinddatai64_t*);
#ifndef __NO_OLDNAMES
/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */
diff --git a/winsup/mingw/include/locale.h b/winsup/mingw/include/locale.h
index 9bd23203c..cfbf9c2bf 100644
--- a/winsup/mingw/include/locale.h
+++ b/winsup/mingw/include/locale.h
@@ -51,7 +51,16 @@
#ifndef RC_INVOKED
+/* According to C89 std, NULL is defined in locale.h too */
+#define __need_NULL
+#include <stddef.h>
+
__BEGIN_CSTD_NAMESPACE
+
+/* According to C89 std, NULL is defined in locale.h too. */
+#define __need_NULL
+#include <stddef.h>
+
/*
* The structure returned by 'localeconv'.
*/
@@ -77,8 +86,8 @@ struct lconv
char n_sign_posn;
};
-char* setlocale (int, const char*);
-struct lconv* localeconv (void);
+_CRTIMP char* __cdecl setlocale (int, const char*);
+_CRTIMP struct lconv* __cdecl localeconv (void);
__END_CSTD_NAMESPACE
@@ -86,7 +95,7 @@ __END_CSTD_NAMESPACE
# define __need_wchar_t
# include <stddef.h>
__BEGIN_CGLOBAL_NAMESPACE
- wchar_t* _wsetlocale(int, const wchar_t*);
+_CRTIMP wchar_t* __cdecl _wsetlocale(int, const wchar_t*);
__END_CGLOBAL_NAMESPACE
# define _WLOCALE_DEFINED
#endif /* ndef _WLOCALE_DEFINED */
diff --git a/winsup/mingw/include/malloc.h b/winsup/mingw/include/malloc.h
index 097a5e1c1..834e0212f 100644
--- a/winsup/mingw/include/malloc.h
+++ b/winsup/mingw/include/malloc.h
@@ -60,26 +60,26 @@ extern "C" {
The _heap* memory allocation functions are supported on NT
but not W9x. On latter, they always set errno to ENOSYS.
*/
-int _heapwalk (_HEAPINFO*);
+_CRTIMP int __cdecl _heapwalk (_HEAPINFO*);
#ifdef __GNUC__
#define _alloca(x) __builtin_alloca((x))
#endif
#ifndef _NO_OLDNAMES
-int heapwalk (_HEAPINFO*);
+_CRTIMP int __cdecl heapwalk (_HEAPINFO*);
#ifdef __GNUC__
#define alloca(x) __builtin_alloca((x))
#endif
#endif /* Not _NO_OLDNAMES */
-int _heapchk (void); /* Verify heap integrety. */
-int _heapmin (void); /* Return unused heap to the OS. */
-int _heapset (unsigned int);
+_CRTIMP int __cdecl _heapchk (void); /* Verify heap integrety. */
+_CRTIMP int __cdecl _heapmin (void); /* Return unused heap to the OS. */
+_CRTIMP int __cdecl _heapset (unsigned int);
-size_t _msize (void*);
-size_t _get_sbh_threshold (void);
-int _set_sbh_threshold (size_t);
-void * _expand (void*, size_t);
+_CRTIMP size_t __cdecl _msize (void*);
+_CRTIMP size_t __cdecl _get_sbh_threshold (void);
+_CRTIMP int __cdecl _set_sbh_threshold (size_t);
+_CRTIMP void* __cdecl _expand (void*, size_t);
#ifdef __cplusplus
}
diff --git a/winsup/mingw/include/math.h b/winsup/mingw/include/math.h
index 377828973..10ca8c538 100644
--- a/winsup/mingw/include/math.h
+++ b/winsup/mingw/include/math.h
@@ -144,34 +144,34 @@ struct _exception
__END_CGLOBAL_NAMESPACE
__BEGIN_CSTD_NAMESPACE
-double sin (double);
-double cos (double);
-double tan (double);
-double sinh (double);
-double cosh (double);
-double tanh (double);
-double asin (double);
-double acos (double);
-double atan (double);
-double atan2 (double, double);
-double exp (double);
-double log (double);
-double log10 (double);
-double pow (double, double);
-double sqrt (double);
-double ceil (double);
-double floor (double);
-double fabs (double);
-extern __inline__ double fabs (double __x)
+_CRTIMP double __cdecl sin (double);
+_CRTIMP double __cdecl cos (double);
+_CRTIMP double __cdecl tan (double);
+_CRTIMP double __cdecl sinh (double);
+_CRTIMP double __cdecl cosh (double);
+_CRTIMP double __cdecl tanh (double);
+_CRTIMP double __cdecl asin (double);
+_CRTIMP double __cdecl acos (double);
+_CRTIMP double __cdecl atan (double);
+_CRTIMP double __cdecl atan2 (double, double);
+_CRTIMP double __cdecl exp (double);
+_CRTIMP double __cdecl log (double);
+_CRTIMP double __cdecl log10 (double);
+ double __cdecl pow (double, double);
+_CRTIMP double __cdecl sqrt (double);
+_CRTIMP double __cdecl ceil (double);
+_CRTIMP double __cdecl floor (double);
+_CRTIMP double __cdecl fabs (double);
+extern __inline__ __cdecl double fabs (double __x)
{
double res;
__asm__ ("fabs;" : "=t" (res) : "0" (__x));
return res;
}
-double ldexp (double, int);
-double frexp (double, int*);
-double modf (double, double*);
-double fmod (double, double);
+_CRTIMP double __cdecl ldexp (double, int);
+_CRTIMP double __cdecl frexp (double, int*);
+_CRTIMP double __cdecl modf (double, double*);
+_CRTIMP double __cdecl fmod (double, double);
__END_CSTD_NAMESPACE
__BEGIN_CGLOBAL_NAMESPACE
@@ -185,16 +185,16 @@ struct _complex
double y; /* Imaginary part */
};
-double _cabs (struct _complex);
+_CRTIMP double __cdecl _cabs (struct _complex);
-double _hypot (double, double);
-double _j0 (double);
-double _j1 (double);
-double _jn (int, double);
-double _y0 (double);
-double _y1 (double);
-double _yn (int, double);
-int _matherr (struct _exception *);
+_CRTIMP double __cdecl _hypot (double, double);
+_CRTIMP double __cdecl _j0 (double);
+_CRTIMP double __cdecl _j1 (double);
+_CRTIMP double __cdecl _jn (int, double);
+_CRTIMP double __cdecl _y0 (double);
+_CRTIMP double __cdecl _y1 (double);
+_CRTIMP double __cdecl _yn (int, double);
+_CRTIMP int __cdecl _matherr (struct _exception *);
/* These are also declared in Mingw float.h; needed here as well to work
around GCC build issues. */
@@ -203,15 +203,15 @@ int _matherr (struct _exception *);
* IEEE recommended functions
*/
-double _chgsign (double);
-double _copysign (double, double);
-double _logb (double);
-double _nextafter (double, double);
-double _scalb (double, long);
+_CRTIMP double __cdecl _chgsign (double);
+_CRTIMP double __cdecl _copysign (double, double);
+_CRTIMP double __cdecl _logb (double);
+_CRTIMP double __cdecl _nextafter (double, double);
+_CRTIMP double __cdecl _scalb (double, long);
-int _finite (double);
-int _fpclass (double);
-int _isnan (double);
+_CRTIMP int __cdecl _finite (double);
+_CRTIMP int __cdecl _fpclass (double);
+_CRTIMP int __cdecl _isnan (double);
/* END FLOAT.H COPY */
@@ -223,18 +223,18 @@ int _isnan (double);
#if !defined (_NO_OLDNAMES)
-double cabs (struct _complex);
-double j0 (double);
-double j1 (double);
-double jn (int, double);
-double y0 (double);
-double y1 (double);
-double yn (int, double);
+_CRTIMP double __cdecl cabs (struct _complex);
+_CRTIMP double __cdecl j0 (double);
+_CRTIMP double __cdecl j1 (double);
+_CRTIMP double __cdecl jn (int, double);
+_CRTIMP double __cdecl y0 (double);
+_CRTIMP double __cdecl y1 (double);
+_CRTIMP double __cdecl yn (int, double);
-double chgsign (double);
-double scalb (double, long);
-int finite (double);
-int fpclass (double);
+_CRTIMP double __cdecl chgsign (double);
+_CRTIMP double __cdecl scalb (double, long);
+_CRTIMP int __cdecl finite (double);
+_CRTIMP int __cdecl fpclass (double);
#endif /* Not _NO_OLDNAMES */
@@ -244,7 +244,7 @@ int fpclass (double);
#ifndef __NO_ISOCEXT
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
- || !defined __STRICT_ANSI__ || defined __GLIBCPP__
+ || !defined __STRICT_ANSI__ || defined __GLIBCPP__
#define NAN (0.0F/0.0F)
#define HUGE_VALF (1.0F/0.0F)
@@ -272,18 +272,18 @@ int fpclass (double);
converted to double, and zero when converted to float.)
*/
-extern int __fpclassifyf (float);
-extern int __fpclassify (double);
+extern int __cdecl __fpclassifyf (float);
+extern int __cdecl __fpclassify (double);
-extern __inline__ int __fpclassifyl (long double __x){
+extern __inline__ __cdecl int __fpclassifyl (long double __x){
unsigned short sw;
__asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (__x));
return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
}
-#define fpclassify(__x) (sizeof (__x) == sizeof (float) ? __fpclassifyf (__x) \
- : sizeof (__x) == sizeof (double) ? __fpclassify (__x) \
- : __fpclassifyl (__x))
+#define fpclassify(__x) (sizeof (__x) == sizeof (float) ? __fpclassifyf (__x) \
+ : sizeof (__x) == sizeof (double) ? __fpclassify (__x) \
+ : __fpclassifyl (__x))
/* 7.12.3.2 */
#define isfinite(__x) ((fpclassify(__x) & FP_NAN) == 0)
@@ -295,7 +295,7 @@ extern __inline__ int __fpclassifyl (long double __x){
/* We don't need to worry about trucation here:
A NaN stays a NaN. */
-extern __inline__ int __isnan (double __x)
+extern __inline__ __cdecl int __isnan (double __x)
{
unsigned short sw;
__asm__ ("fxam;"
@@ -304,7 +304,7 @@ extern __inline__ int __isnan (double __x)
== FP_NAN;
}
-extern __inline__ int __isnanf (float __x)
+extern __inline__ __cdecl int __isnanf (float __x)
{
unsigned short sw;
__asm__ ("fxam;"
@@ -313,7 +313,7 @@ extern __inline__ int __isnanf (float __x)
== FP_NAN;
}
-extern __inline__ int __isnanl (long double __x)
+extern __inline__ __cdecl int __isnanl (long double __x)
{
unsigned short sw;
__asm__ ("fxam;"
@@ -331,18 +331,18 @@ extern __inline__ int __isnanl (long double __x)
#define isnormal(__x) (fpclassify(__x) == FP_NORMAL)
/* 7.12.3.6 The signbit macro */
-extern __inline__ int __signbit (double __x) {
+extern __inline__ int __cdecl __signbit (double __x) {
unsigned short stw;
__asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (__x));
return stw & 0x0200;
}
-extern __inline__ int __signbitf (float __x) {
+extern __inline__ int __cdecl __signbitf (float __x) {
unsigned short stw;
__asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (__x));
return stw & 0x0200;
}
-extern __inline__ int __signbitl (long double __x) {
+extern __inline__ int __cdecl __signbitl (long double __x) {
unsigned short stw;
__asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (__x));
return stw & 0x0200;
@@ -354,97 +354,97 @@ extern __inline__ int __signbitl (long double __x) {
: __signbitl (__x))
/* 7.12.4 Trigonometric functions: Double in C89 */
-extern float sinf (float);
-extern long double sinl (long double);
+extern float __cdecl sinf (float);
+extern long __cdecl double sinl (long double);
-extern float cosf (float);
-extern long double cosl (long double);
+extern float __cdecl cosf (float);
+extern long double __cdecl cosl (long double);
-extern float tanf (float);
-extern long double tanl (long double);
+extern float __cdecl tanf (float);
+extern long double __cdecl tanl (long double);
-extern float asinf (float);
-extern long double asinl (long double);
+extern float __cdecl asinf (float);
+extern long double __cdecl asinl (long double);
-extern float acosf (float);
+extern float __cdecl acosf (float);
extern long double acosl (long double);
-extern float atanf (float);
+extern float __cdecl atanf (float);
extern long double atanl (long double);
-extern float atan2f (float, float);
-extern long double atan2l (long double, long double);
+extern float __cdecl atan2f (float, float);
+extern long double __cdecl atan2l (long double, long double);
/* 7.12.5 Hyperbolic functions: Double in C89 */
-extern __inline__ float sinhf (float __x)
+extern __inline__ float __cdecl sinhf (float __x)
{return (float) __CSTD sinh (__x);}
-extern long double sinhl (long double);
+extern long double __cdecl sinhl (long double);
-extern __inline__ float coshf (float __x)
+extern __inline__ float __cdecl coshf (float __x)
{return (float) __CSTD cosh (__x);}
-extern long double coshl (long double);
+extern long double __cdecl coshl (long double);
-extern __inline__ float tanhf (float __x)
+extern __inline__ float __cdecl tanhf (float __x)
{return (float) __CSTD tanh (__x);}
-extern long double tanhl (long double);
+extern long double __cdecl tanhl (long double);
/*
* TODO: asinh, acosh, atanh
*/
/* 7.12.6.1 Double in C89 */
-extern __inline__ float expf (float __x)
+extern __inline__ float __cdecl expf (float __x)
{return (float) __CSTD exp (__x);}
-extern long double expl (long double);
+extern long double __cdecl expl (long double);
/* 7.12.6.2 */
-extern double exp2(double);
-extern float exp2f(float);
-extern long double exp2l(long double);
+extern double __cdecl exp2(double);
+extern float __cdecl exp2f(float);
+extern long double __cdecl exp2l(long double);
/* 7.12.6.3 The expm1 functions: TODO */
/* 7.12.6.4 Double in C89 */
-extern __inline__ float frexpf (float __x, int* __expn)
+extern __inline__ float __cdecl frexpf (float __x, int* __expn)
{return (float) __CSTD frexp (__x, __expn);}
-extern long double frexpl (long double, int*);
+extern long double __cdecl frexpl (long double, int*);
/* 7.12.6.5 */
#define FP_ILOGB0 ((int)0x80000000)
#define FP_ILOGBNAN ((int)0x80000000)
-extern int ilogb (double);
-extern int ilogbf (float);
-extern int ilogbl (long double);
+extern int __cdecl ilogb (double);
+extern int __cdecl ilogbf (float);
+extern int __cdecl ilogbl (long double);
/* 7.12.6.6 Double in C89 */
-extern __inline__ float ldexpf (float __x, int __expn)
+extern __inline__ float __cdecl ldexpf (float __x, int __expn)
{return (float) __CSTD ldexp (__x, __expn);}
-extern long double ldexpl (long double, int);
+extern long double __cdecl ldexpl (long double, int);
/* 7.12.6.7 Double in C89 */
-extern float logf (float);
-extern long double logl (long double);
+extern float __cdecl logf (float);
+extern long double __cdecl logl (long double);
/* 7.12.6.8 Double in C89 */
-extern float log10f (float);
-extern long double log10l (long double);
+extern float __cdecl log10f (float);
+extern long double __cdecl log10l (long double);
/* 7.12.6.9 */
-extern double log1p(double);
-extern float log1pf(float);
-extern long double log1pl(long double);
+extern double __cdecl log1p(double);
+extern float __cdecl log1pf(float);
+extern long double __cdecl log1pl(long double);
/* 7.12.6.10 */
-extern double log2 (double);
-extern float log2f (float);
-extern long double log2l (long double);
+extern double __cdecl log2 (double);
+extern float __cdecl log2f (float);
+extern long double __cdecl log2l (long double);
/* 7.12.6.11 */
-extern double logb (double);
-extern float logbf (float);
-extern long double logbl (long double);
+extern double __cdecl logb (double);
+extern float __cdecl logbf (float);
+extern long double __cdecl logbl (long double);
-extern __inline__ double logb (double __x)
+extern __inline__ double __cdecl logb (double __x)
{
double res;
__asm__ ("fxtract\n\t"
@@ -452,7 +452,7 @@ extern __inline__ double logb (double __x)
return res;
}
-extern __inline__ float logbf (float __x)
+extern __inline__ float __cdecl logbf (float __x)
{
float res;
__asm__ ("fxtract\n\t"
@@ -460,7 +460,7 @@ extern __inline__ float logbf (float __x)
return res;
}
-extern __inline__ long double logbl (long double __x)
+extern __inline__ long double __cdecl logbl (long double __x)
{
long double res;
__asm__ ("fxtract\n\t"
@@ -469,33 +469,33 @@ extern __inline__ long double logbl (long double __x)
}
/* 7.12.6.12 Double in C89 */
-extern float modff (float, float*);
-extern long double modfl (long double, long double*);
+extern float __cdecl modff (float, float*);
+extern long double __cdecl modfl (long double, long double*);
/* 7.12.6.13 */
-extern double scalbn (double, int);
-extern float scalbnf (float, int);
-extern long double scalbnl (long double, int);
+extern double __cdecl scalbn (double, int);
+extern float __cdecl scalbnf (float, int);
+extern long double __cdecl scalbnl (long double, int);
-extern double scalbln (double, long);
-extern float scalblnf (float, long);
-extern long double scalblnl (long double, long);
+extern double __cdecl scalbln (double, long);
+extern float __cdecl scalblnf (float, long);
+extern long double __cdecl scalblnl (long double, long);
/* 7.12.7.1 */
/* Implementations adapted from Cephes versions */
-extern double cbrt (double);
-extern float cbrtf (float);
-extern long double cbrtl (long double);
+extern double __cdecl cbrt (double);
+extern float __cdecl cbrtf (float);
+extern long double __cdecl cbrtl (long double);
/* 7.12.7.2 The fabs functions: Double in C89 */
-extern __inline__ float fabsf (float __x)
+extern __inline__ float __cdecl fabsf (float __x)
{
float res;
__asm__ ("fabs;" : "=t" (res) : "0" (__x));
return res;
}
-extern __inline__ long double fabsl (long double __x)
+extern __inline__ long double __cdecl fabsl (long double __x)
{
long double res;
__asm__ ("fabs;" : "=t" (res) : "0" (__x));
@@ -503,74 +503,74 @@ extern __inline__ long double fabsl (long double __x)
}
/* 7.12.7.3 */
-extern double hypot (double, double); /* in libmoldname.a */
-extern __inline__ float hypotf (float __x, float __y)
+extern double __cdecl hypot (double, double); /* in libmoldname.a */
+extern __inline__ float __cdecl hypotf (float __x, float __y)
{ return (float) hypot (__x, __y);}
-extern long double hypotl (long double, long double);
+extern long double __cdecl hypotl (long double, long double);
/* 7.12.7.4 The pow functions. Double in C89 */
-extern __inline__ float powf (float __x, float __y)
+extern __inline__ float __cdecl powf (float __x, float __y)
{return (float) __CSTD pow (__x, __y);}
-extern long double powl (long double, long double);
+extern long double __cdecl powl (long double, long double);
/* 7.12.7.5 The sqrt functions. Double in C89. */
-extern float sqrtf (float);
-extern long double sqrtl (long double);
+extern float __cdecl sqrtf (float);
+extern long double __cdecl sqrtl (long double);
/* 7.12.8.1 The erf functions */
-extern double erf (double);
-extern float erff (float);
+extern double __cdecl erf (double);
+extern float __cdecl erff (float);
/* TODO
-extern long double erfl (long double);
+extern long double __cdecl erfl (long double);
*/
/* 7.12.8.2 The erfc functions */
-extern double erfc (double);
-extern float erfcf (float);
+extern double __cdecl erfc (double);
+extern float __cdecl erfcf (float);
/* TODO
-extern long double erfcl (long double);
+extern long double __cdecl erfcl (long double);
*/
/* 7.12.8.3 The lgamma functions */
-extern double lgamma (double);
-extern float lgammaf (float);
-extern long double lgammal (long double);
+extern double __cdecl lgamma (double);
+extern float __cdecl lgammaf (float);
+extern long double __cdecl lgammal (long double);
/* 7.12.8.4 The tgamma functions */
-extern double tgamma (double);
-extern float tgammaf (float);
-extern long double tgammal (long double);
+extern double __cdecl tgamma (double);
+extern float __cdecl tgammaf (float);
+extern long double __cdecl tgammal (long double);
/* 7.12.9.1 Double in C89 */
-extern float ceilf (float);
-extern long double ceill (long double);
+extern float __cdecl ceilf (float);
+extern long double __cdecl ceill (long double);
/* 7.12.9.2 Double in C89 */
-extern float floorf (float);
-extern long double floorl (long double);
+extern float __cdecl floorf (float);
+extern long double __cdecl floorl (long double);
/* 7.12.9.3 */
-extern double nearbyint ( double);
-extern float nearbyintf (float);
-extern long double nearbyintl (long double);
+extern double __cdecl nearbyint ( double);
+extern float __cdecl nearbyintf (float);
+extern long double __cdecl nearbyintl (long double);
/* 7.12.9.4 */
/* round, using fpu control word settings */
-extern __inline__ double rint (double __x)
+extern __inline__ double __cdecl rint (double __x)
{
double retval;
__asm__ ("frndint;": "=t" (retval) : "0" (__x));
return retval;
}
-extern __inline__ float rintf (float __x)
+extern __inline__ float __cdecl rintf (float __x)
{
float retval;
__asm__ ("frndint;" : "=t" (retval) : "0" (__x) );
return retval;
}
-extern __inline__ long double rintl (long double __x)
+extern __inline__ long double __cdecl rintl (long double __x)
{
long double retval;
__asm__ ("frndint;" : "=t" (retval) : "0" (__x) );
@@ -578,7 +578,7 @@ extern __inline__ long double rintl (long double __x)
}
/* 7.12.9.5 */
-extern __inline__ long lrint (double __x)
+extern __inline__ long __cdecl lrint (double __x)
{
long retval;
__asm__ __volatile__ \
@@ -586,7 +586,7 @@ extern __inline__ long lrint (double __x)
return retval;
}
-extern __inline__ long lrintf (float __x)
+extern __inline__ long __cdecl lrintf (float __x)
{
long retval;
__asm__ __volatile__ \
@@ -594,7 +594,7 @@ extern __inline__ long lrintf (float __x)
return retval;
}
-extern __inline__ long lrintl (long double __x)
+extern __inline__ long __cdecl lrintl (long double __x)
{
long retval;
__asm__ __volatile__ \
@@ -602,7 +602,7 @@ extern __inline__ long lrintl (long double __x)
return retval;
}
-extern __inline__ long long llrint (double __x)
+extern __inline__ long long __cdecl llrint (double __x)
{
long long retval;
__asm__ __volatile__ \
@@ -610,7 +610,7 @@ extern __inline__ long long llrint (double __x)
return retval;
}
-extern __inline__ long long llrintf (float __x)
+extern __inline__ long long __cdecl llrintf (float __x)
{
long long retval;
__asm__ __volatile__ \
@@ -618,7 +618,7 @@ extern __inline__ long long llrintf (float __x)
return retval;
}
-extern __inline__ long long llrintl (long double __x)
+extern __inline__ long long __cdecl llrintl (long double __x)
{
long long retval;
__asm__ __volatile__ \
@@ -628,48 +628,48 @@ extern __inline__ long long llrintl (long double __x)
/* 7.12.9.6 */
/* round away from zero, regardless of fpu control word settings */
-extern double round (double);
-extern float roundf (float);
-extern long double roundl (long double);
+extern double __cdecl round (double);
+extern float __cdecl roundf (float);
+extern long double __cdecl roundl (long double);
/* 7.12.9.7 */
-extern long lround (double);
-extern long lroundf (float);
-extern long lroundl (long double);
+extern long __cdecl lround (double);
+extern long __cdecl lroundf (float);
+extern long __cdecl lroundl (long double);
-extern long long llround (double);
-extern long long llroundf (float);
-extern long long llroundl (long double);
+extern long long __cdecl llround (double);
+extern long long __cdecl llroundf (float);
+extern long long __cdecl llroundl (long double);
/* 7.12.9.8 */
/* round towards zero, regardless of fpu control word settings */
-extern double trunc (double);
-extern float truncf (float);
-extern long double truncl (long double);
+extern double __cdecl trunc (double);
+extern float __cdecl truncf (float);
+extern long double __cdecl truncl (long double);
/* 7.12.10.1 Double in C89 */
-extern float fmodf (float, float);
-extern long double fmodl (long double, long double);
+extern float __cdecl fmodf (float, float);
+extern long double __cdecl fmodl (long double, long double);
/* 7.12.10.2 */
-extern double remainder (double, double);
-extern float remainderf (float, float);
-extern long double remainderl (long double, long double);
+extern double __cdecl remainder (double, double);
+extern float __cdecl remainderf (float, float);
+extern long double __cdecl remainderl (long double, long double);
/* 7.12.10.3 */
-extern double remquo(double, double, int *);
-extern float remquof(float, float, int *);
-extern long double remquol(long double, long double, int *);
+extern double __cdecl remquo(double, double, int *);
+extern float __cdecl remquof(float, float, int *);
+extern long double __cdecl remquol(long double, long double, int *);
/* 7.12.11.1 */
-extern double copysign (double, double); /* in libmoldname.a */
-extern float copysignf (float, float);
-extern long double copysignl (long double, long double);
+extern double __cdecl copysign (double, double); /* in libmoldname.a */
+extern float __cdecl copysignf (float, float);
+extern long double __cdecl copysignl (long double, long double);
/* 7.12.11.2 Return a NaN */
-extern double nan(const char *tagp);
-extern float nanf(const char *tagp);
-extern long double nanl(const char *tagp);
+extern double __cdecl nan(const char *tagp);
+extern float __cdecl nanf(const char *tagp);
+extern long double __cdecl nanl(const char *tagp);
#ifndef __STRICT_ANSI__
#define _nan() nan("")
@@ -678,8 +678,8 @@ extern long double nanl(const char *tagp);
#endif
/* 7.12.11.3 */
-extern double nextafter (double, double); /* in libmoldname.a */
-extern float nextafterf (float, float);
+extern double __cdecl nextafter (double, double); /* in libmoldname.a */
+extern float __cdecl nextafterf (float, float);
/* TODO: Not yet implemented */
/* extern long double nextafterl (long double, long double); */
@@ -687,9 +687,9 @@ extern float nextafterf (float, float);
/* 7.12.12.1 */
/* x > y ? (x - y) : 0.0 */
-extern double fdim (double __x, double __y);
-extern float fdimf (float __x, float __y);
-extern long double fdiml (long double __x, long double __y);
+extern double __cdecl fdim (double __x, double __y);
+extern float __cdecl fdimf (float __x, float __y);
+extern long double __cdecl fdiml (long double __x, long double __y);
/* fmax and fmin.
NaN arguments are treated as missing data: if one argument is a NaN
@@ -697,20 +697,20 @@ extern long double fdiml (long double __x, long double __y);
value. */
/* 7.12.12.2 */
-extern double fmax (double, double);
-extern float fmaxf (float, float);
-extern long double fmaxl (long double, long double);
+extern double __cdecl fmax (double, double);
+extern float __cdecl fmaxf (float, float);
+extern long double __cdecl fmaxl (long double, long double);
/* 7.12.12.3 */
-extern double fmin (double, double);
-extern float fminf (float, float);
-extern long double fminl (long double, long double);
+extern double __cdecl fmin (double, double);
+extern float __cdecl fminf (float, float);
+extern long double __cdecl fminl (long double, long double);
/* 7.12.13.1 */
/* return x * y + z as a ternary op */
-extern double fma (double, double, double);
-extern float fmaf (float, float, float);
-extern long double fmal (long double, long double, long double);
+extern double __cdecl fma (double, double, double);
+extern float __cdecl fmaf (float, float, float);
+extern long double __cdecl fmal (long double, long double, long double);
/* 7.12.14 */
/*
@@ -732,7 +732,7 @@ extern long double fmal (long double, long double, long double);
#else
/* helper */
-extern __inline__ int
+extern __inline__ int __cdecl
__fp_unordered_compare (long double __x, long double __y){
unsigned short retval;
__asm__ ("fucom %%st(1);"
diff --git a/winsup/mingw/include/mbctype.h b/winsup/mingw/include/mbctype.h
index 346e6d790..dd57a7b5c 100644
--- a/winsup/mingw/include/mbctype.h
+++ b/winsup/mingw/include/mbctype.h
@@ -54,29 +54,29 @@ extern "C" {
#ifndef __STRICT_ANSI__
-int _setmbcp (int);
-int _getmbcp (void);
+_CRTIMP int __cdecl _setmbcp (int);
+_CRTIMP int __cdecl _getmbcp (void);
/* byte classification */
/* NB: Corresponding _ismbc* functions are in mbstring.h */
-int _ismbbalpha (unsigned int);
-int _ismbbalnum (unsigned int);
-int _ismbbgraph (unsigned int);
-int _ismbbprint (unsigned int);
-int _ismbbpunct (unsigned int);
+_CRTIMP int __cdecl _ismbbalpha (unsigned int);
+_CRTIMP int __cdecl _ismbbalnum (unsigned int);
+_CRTIMP int __cdecl _ismbbgraph (unsigned int);
+_CRTIMP int __cdecl _ismbbprint (unsigned int);
+_CRTIMP int __cdecl _ismbbpunct (unsigned int);
-int _ismbbkana (unsigned int);
-int _ismbbkalnum (unsigned int);
-int _ismbbkprint (unsigned int);
-int _ismbbkpunct (unsigned int);
+_CRTIMP int __cdecl _ismbbkana (unsigned int);
+_CRTIMP int __cdecl _ismbbkalnum (unsigned int);
+_CRTIMP int __cdecl _ismbbkprint (unsigned int);
+_CRTIMP int __cdecl _ismbbkpunct (unsigned int);
/* these are also in mbstring.h */
-int _ismbblead (unsigned int);
-int _ismbbtrail (unsigned int);
-int _ismbslead (const unsigned char*, const unsigned char*);
-int _ismbstrail (const unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _ismbblead (unsigned int);
+_CRTIMP int __cdecl _ismbbtrail (unsigned int);
+_CRTIMP int __cdecl _ismbslead (const unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _ismbstrail (const unsigned char*, const unsigned char*);
#ifdef __DECLSPEC_SUPPORTED
__MINGW_IMPORT unsigned char _mbctype[];
diff --git a/winsup/mingw/include/mbstring.h b/winsup/mingw/include/mbstring.h
index 6b89ebd76..4ad777602 100644
--- a/winsup/mingw/include/mbstring.h
+++ b/winsup/mingw/include/mbstring.h
@@ -36,89 +36,89 @@ extern "C" {
#ifndef __STRICT_ANSI__
/* character classification */
-int _ismbcalnum (unsigned int);
-int _ismbcalpha (unsigned int);
-int _ismbcdigit (unsigned int);
-int _ismbcgraph (unsigned int);
-int _ismbcprint (unsigned int);
-int _ismbcpunct (unsigned int);
-int _ismbcspace (unsigned int);
-int _ismbclower (unsigned int);
-int _ismbcupper (unsigned int);
-int _ismbclegal (unsigned int);
-int _ismbcsymbol (unsigned int);
+_CRTIMP int __cdecl _ismbcalnum (unsigned int);
+_CRTIMP int __cdecl _ismbcalpha (unsigned int);
+_CRTIMP int __cdecl _ismbcdigit (unsigned int);
+_CRTIMP int __cdecl _ismbcgraph (unsigned int);
+_CRTIMP int __cdecl _ismbcprint (unsigned int);
+_CRTIMP int __cdecl _ismbcpunct (unsigned int);
+_CRTIMP int __cdecl _ismbcspace (unsigned int);
+_CRTIMP int __cdecl _ismbclower (unsigned int);
+_CRTIMP int __cdecl _ismbcupper (unsigned int);
+_CRTIMP int __cdecl _ismbclegal (unsigned int);
+_CRTIMP int __cdecl _ismbcsymbol (unsigned int);
/* also in mbctype.h */
-int _ismbblead (unsigned int );
-int _ismbbtrail (unsigned int );
-int _ismbslead ( const unsigned char*, const unsigned char*);
-int _ismbstrail ( const unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _ismbblead (unsigned int );
+_CRTIMP int __cdecl _ismbbtrail (unsigned int );
+_CRTIMP int __cdecl _ismbslead ( const unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _ismbstrail ( const unsigned char*, const unsigned char*);
-unsigned int _mbctolower (unsigned int);
-unsigned int _mbctoupper (unsigned int);
+_CRTIMP unsigned int __cdecl _mbctolower (unsigned int);
+_CRTIMP unsigned int __cdecl _mbctoupper (unsigned int);
-void _mbccpy (unsigned char*, const unsigned char*);
-size_t _mbclen (const unsigned char*);
+_CRTIMP void __cdecl _mbccpy (unsigned char*, const unsigned char*);
+_CRTIMP size_t __cdecl _mbclen (const unsigned char*);
-unsigned int _mbbtombc (unsigned int);
-unsigned int _mbctombb (unsigned int);
+_CRTIMP unsigned int __cdecl _mbbtombc (unsigned int);
+_CRTIMP unsigned int __cdecl _mbctombb (unsigned int);
/* Return value constants for these are defined in mbctype.h. */
-int _mbbtype (unsigned char, int);
-int _mbsbtype (const unsigned char*, size_t);
-
-unsigned char* _mbscpy (unsigned char*, const unsigned char*);
-unsigned char* _mbsncpy (unsigned char*, const unsigned char*, size_t);
-unsigned char* _mbsnbcpy (unsigned char*, const unsigned char*, size_t);
-unsigned char* _mbsset (unsigned char*, unsigned int);
-unsigned char* _mbsnset (unsigned char*, unsigned int, size_t);
-unsigned char* _mbsnbset (unsigned char*, unsigned int, size_t);
-unsigned char* _mbsdup (const unsigned char*);
-unsigned char* _mbsrev (unsigned char*);
-unsigned char* _mbscat (unsigned char*, const unsigned char*);
-unsigned char* _mbsncat (unsigned char*, const unsigned char*, size_t);
-unsigned char* _mbsnbcat (unsigned char*, const unsigned char*, size_t);
-size_t _mbslen (const unsigned char*);
-size_t _mbsnbcnt (const unsigned char*, size_t);
-size_t _mbsnccnt (const unsigned char*, size_t);
-unsigned char* _mbschr (const unsigned char*, unsigned int);
-unsigned char* _mbsrchr (const unsigned char*, unsigned int);
-size_t _mbsspn (const unsigned char*, const unsigned char*);
-size_t _mbscspn (const unsigned char*, const unsigned char*);
-unsigned char* _mbsspnp (const unsigned char*, const unsigned char*);
-unsigned char* _mbspbrk (const unsigned char*, const unsigned char*);
-int _mbscmp (const unsigned char*, const unsigned char*);
-int _mbsicmp (const unsigned char*, const unsigned char*);
-int _mbsncmp (const unsigned char*, const unsigned char*, size_t);
-int _mbsnicmp (const unsigned char*, const unsigned char*, size_t);
-int _mbsnbcmp (const unsigned char*, const unsigned char*, size_t);
-int _mbsnbicmp (const unsigned char*, const unsigned char*, size_t);
-int _mbscoll (const unsigned char*, const unsigned char*);
-int _mbsicoll (const unsigned char*, const unsigned char*);
-int _mbsncoll (const unsigned char*, const unsigned char*, size_t);
-int _mbsnicoll (const unsigned char*, const unsigned char*, size_t);
-int _mbsnbcoll (const unsigned char*, const unsigned char*, size_t);
-int _mbsnbicoll (const unsigned char*, const unsigned char*, size_t);
-
-unsigned char* _mbsinc (const unsigned char*);
-unsigned char* _mbsninc (const unsigned char*, size_t);
-unsigned char* _mbsdec (const unsigned char*, const unsigned char*);
-unsigned int _mbsnextc (const unsigned char*);
-unsigned char* _mbslwr (unsigned char*);
-unsigned char* _mbsupr (unsigned char*);
-unsigned char* _mbstok (unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _mbbtype (unsigned char, int);
+_CRTIMP int __cdecl _mbsbtype (const unsigned char*, size_t);
+
+_CRTIMP unsigned char* __cdecl _mbscpy (unsigned char*, const unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbsncpy (unsigned char*, const unsigned char*, size_t);
+_CRTIMP unsigned char* __cdecl _mbsnbcpy (unsigned char*, const unsigned char*, size_t);
+_CRTIMP unsigned char* __cdecl _mbsset (unsigned char*, unsigned int);
+_CRTIMP unsigned char* __cdecl _mbsnset (unsigned char*, unsigned int, size_t);
+_CRTIMP unsigned char* __cdecl _mbsnbset (unsigned char*, unsigned int, size_t);
+_CRTIMP unsigned char* __cdecl _mbsdup (const unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbsrev (unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbscat (unsigned char*, const unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbsncat (unsigned char*, const unsigned char*, size_t);
+_CRTIMP unsigned char* __cdecl _mbsnbcat (unsigned char*, const unsigned char*, size_t);
+_CRTIMP size_t __cdecl _mbslen (const unsigned char*);
+_CRTIMP size_t __cdecl _mbsnbcnt (const unsigned char*, size_t);
+_CRTIMP size_t __cdecl _mbsnccnt (const unsigned char*, size_t);
+_CRTIMP unsigned char* __cdecl _mbschr (const unsigned char*, unsigned int);
+_CRTIMP unsigned char* __cdecl _mbsrchr (const unsigned char*, unsigned int);
+_CRTIMP size_t __cdecl _mbsspn (const unsigned char*, const unsigned char*);
+_CRTIMP size_t __cdecl _mbscspn (const unsigned char*, const unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbsspnp (const unsigned char*, const unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbspbrk (const unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _mbscmp (const unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _mbsicmp (const unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _mbsncmp (const unsigned char*, const unsigned char*, size_t);
+_CRTIMP int __cdecl _mbsnicmp (const unsigned char*, const unsigned char*, size_t);
+_CRTIMP int __cdecl _mbsnbcmp (const unsigned char*, const unsigned char*, size_t);
+_CRTIMP int __cdecl _mbsnbicmp (const unsigned char*, const unsigned char*, size_t);
+_CRTIMP int __cdecl _mbscoll (const unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _mbsicoll (const unsigned char*, const unsigned char*);
+_CRTIMP int __cdecl _mbsncoll (const unsigned char*, const unsigned char*, size_t);
+_CRTIMP int __cdecl _mbsnicoll (const unsigned char*, const unsigned char*, size_t);
+_CRTIMP int __cdecl _mbsnbcoll (const unsigned char*, const unsigned char*, size_t);
+_CRTIMP int __cdecl _mbsnbicoll (const unsigned char*, const unsigned char*, size_t);
+
+_CRTIMP unsigned char* __cdecl _mbsinc (const unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbsninc (const unsigned char*, size_t);
+_CRTIMP unsigned char* __cdecl _mbsdec (const unsigned char*, const unsigned char*);
+_CRTIMP unsigned int __cdecl _mbsnextc (const unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbslwr (unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbsupr (unsigned char*);
+_CRTIMP unsigned char* __cdecl _mbstok (unsigned char*, const unsigned char*);
/* Kanji */
-int _ismbchira (unsigned int);
-int _ismbckata (unsigned int);
-int _ismbcl0 (unsigned int);
-int _ismbcl1 (unsigned int);
-int _ismbcl2 (unsigned int);
-unsigned int _mbcjistojms (unsigned int);
-unsigned int _mbcjmstojis (unsigned int);
-unsigned int _mbctohira (unsigned int);
-unsigned int _mbctokata (unsigned int);
+_CRTIMP int __cdecl _ismbchira (unsigned int);
+_CRTIMP int __cdecl _ismbckata (unsigned int);
+_CRTIMP int __cdecl _ismbcl0 (unsigned int);
+_CRTIMP int __cdecl _ismbcl1 (unsigned int);
+_CRTIMP int __cdecl _ismbcl2 (unsigned int);
+_CRTIMP unsigned int __cdecl _mbcjistojms (unsigned int);
+_CRTIMP unsigned int __cdecl _mbcjmstojis (unsigned int);
+_CRTIMP unsigned int __cdecl _mbctohira (unsigned int);
+_CRTIMP unsigned int __cdecl _mbctokata (unsigned int);
#endif /* Not strict ANSI */
diff --git a/winsup/mingw/include/process.h b/winsup/mingw/include/process.h
index adf19e8cd..3fb8ed7e0 100644
--- a/winsup/mingw/include/process.h
+++ b/winsup/mingw/include/process.h
@@ -73,30 +73,30 @@
extern "C" {
#endif
-void _cexit(void);
-void _c_exit(void);
-
-int _cwait (int*, _pid_t, int);
-
-_pid_t _getpid(void);
-
-int _execl (const char*, const char*, ...);
-int _execle (const char*, const char*, ...);
-int _execlp (const char*, const char*, ...);
-int _execlpe (const char*, const char*, ...);
-int _execv (const char*, char* const*);
-int _execve (const char*, char* const*, char* const*);
-int _execvp (const char*, char* const*);
-int _execvpe (const char*, char* const*, char* const*);
-
-int _spawnl (int, const char*, const char*, ...);
-int _spawnle (int, const char*, const char*, ...);
-int _spawnlp (int, const char*, const char*, ...);
-int _spawnlpe (int, const char*, const char*, ...);
-int _spawnv (int, const char*, char* const*);
-int _spawnve (int, const char*, char* const*, char* const*);
-int _spawnvp (int, const char*, char* const*);
-int _spawnvpe (int, const char*, char* const*, char* const*);
+_CRTIMP void __cdecl _cexit(void);
+_CRTIMP void __cdecl _c_exit(void);
+
+_CRTIMP int __cdecl _cwait (int*, _pid_t, int);
+
+_CRTIMP _pid_t __cdecl _getpid(void);
+
+_CRTIMP int __cdecl _execl (const char*, const char*, ...);
+_CRTIMP int __cdecl _execle (const char*, const char*, ...);
+_CRTIMP int __cdecl _execlp (const char*, const char*, ...);
+_CRTIMP int __cdecl _execlpe (const char*, const char*, ...);
+_CRTIMP int __cdecl _execv (const char*, char* const*);
+_CRTIMP int __cdecl _execve (const char*, char* const*, char* const*);
+_CRTIMP int __cdecl _execvp (const char*, char* const*);
+_CRTIMP int __cdecl _execvpe (const char*, char* const*, char* const*);
+
+_CRTIMP int __cdecl _spawnl (int, const char*, const char*, ...);
+_CRTIMP int __cdecl _spawnle (int, const char*, const char*, ...);
+_CRTIMP int __cdecl _spawnlp (int, const char*, const char*, ...);
+_CRTIMP int __cdecl _spawnlpe (int, const char*, const char*, ...);
+_CRTIMP int __cdecl _spawnv (int, const char*, char* const*);
+_CRTIMP int __cdecl _spawnve (int, const char*, char* const*, char* const*);
+_CRTIMP int __cdecl _spawnvp (int, const char*, char* const*);
+_CRTIMP int __cdecl _spawnvpe (int, const char*, char* const*, char* const*);
/*
* The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
@@ -109,15 +109,15 @@ int _spawnvpe (int, const char*, char* const*, char* const*);
*
* NOTE: No old names for these functions. Use the underscore.
*/
-unsigned long
+_CRTIMP unsigned long __cdecl
_beginthread (void (*)(void *), unsigned, void*);
-void _endthread (void);
+_CRTIMP void __cdecl _endthread (void);
#ifdef __MSVCRT__
-unsigned long
+_CRTIMP unsigned long __cdecl
_beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *),
void*, unsigned, unsigned*);
-void _endthreadex (unsigned);
+_CRTIMP void __cdecl _endthreadex (unsigned);
#endif
@@ -126,24 +126,24 @@ void _endthreadex (unsigned);
* Functions without the leading underscore, for portability. These functions
* live in liboldnames.a.
*/
-int cwait (int*, pid_t, int);
-pid_t getpid (void);
-int execl (const char*, const char*, ...);
-int execle (const char*, const char*, ...);
-int execlp (const char*, const char*, ...);
-int execlpe (const char*, const char*, ...);
-int execv (const char*, char* const*);
-int execve (const char*, char* const*, char* const*);
-int execvp (const char*, char* const*);
-int execvpe (const char*, char* const*, char* const*);
-int spawnl (int, const char*, const char*, ...);
-int spawnle (int, const char*, const char*, ...);
-int spawnlp (int, const char*, const char*, ...);
-int spawnlpe (int, const char*, const char*, ...);
-int spawnv (int, const char*, char* const*);
-int spawnve (int, const char*, char* const*, char* const*);
-int spawnvp (int, const char*, char* const*);
-int spawnvpe (int, const char*, char* const*, char* const*);
+_CRTIMP int __cdecl cwait (int*, pid_t, int);
+_CRTIMP pid_t __cdecl getpid (void);
+_CRTIMP int __cdecl execl (const char*, const char*, ...);
+_CRTIMP int __cdecl execle (const char*, const char*, ...);
+_CRTIMP int __cdecl execlp (const char*, const char*, ...);
+_CRTIMP int __cdecl execlpe (const char*, const char*, ...);
+_CRTIMP int __cdecl execv (const char*, char* const*);
+_CRTIMP int __cdecl execve (const char*, char* const*, char* const*);
+_CRTIMP int __cdecl execvp (const char*, char* const*);
+_CRTIMP int __cdecl execvpe (const char*, char* const*, char* const*);
+_CRTIMP int __cdecl spawnl (int, const char*, const char*, ...);
+_CRTIMP int __cdecl spawnle (int, const char*, const char*, ...);
+_CRTIMP int __cdecl spawnlp (int, const char*, const char*, ...);
+_CRTIMP int __cdecl spawnlpe (int, const char*, const char*, ...);
+_CRTIMP int __cdecl spawnv (int, const char*, char* const*);
+_CRTIMP int __cdecl spawnve (int, const char*, char* const*, char* const*);
+_CRTIMP int __cdecl spawnvp (int, const char*, char* const*);
+_CRTIMP int __cdecl spawnvpe (int, const char*, char* const*, char* const*);
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
diff --git a/winsup/mingw/include/setjmp.h b/winsup/mingw/include/setjmp.h
index 08de24dc0..6737b7257 100644
--- a/winsup/mingw/include/setjmp.h
+++ b/winsup/mingw/include/setjmp.h
@@ -50,7 +50,7 @@ typedef _JBTYPE jmp_buf[_JBLEN];
* Return to the last setjmp call and act as if setjmp had returned
* nVal (which had better be non-zero!).
*/
-void longjmp (jmp_buf, int);
+_CRTIMP void __cdecl longjmp (jmp_buf, int);
__END_CSTD_NAMESPACE
__BEGIN_CGLOBAL_NAMESPACE
@@ -58,7 +58,7 @@ __BEGIN_CGLOBAL_NAMESPACE
* The function provided by CRTDLL which appears to do the actual work
* of setjmp.
*/
-int _setjmp (__CSTD jmp_buf);
+_CRTIMP int __cdecl _setjmp (__CSTD jmp_buf);
#define setjmp(x) _setjmp(x)
__END_CGLOBAL_NAMESPACE
diff --git a/winsup/mingw/include/signal.h b/winsup/mingw/include/signal.h
index 51979b838..8660be0bf 100644
--- a/winsup/mingw/include/signal.h
+++ b/winsup/mingw/include/signal.h
@@ -93,12 +93,12 @@ typedef int sig_atomic_t;
* previous handler, or SIG_ERR if an error occurs. Initially
* unhandled signals defined above will return SIG_DFL.
*/
-__p_sig_fn_t signal(int, __p_sig_fn_t);
+_CRTIMP __p_sig_fn_t __cdecl signal(int, __p_sig_fn_t);
/*
* Raise the signal indicated by sig. Returns non-zero on success.
*/
-int raise (int);
+_CRTIMP int __cdecl raise (int);
__END_CSTD_NAMESPACE
diff --git a/winsup/mingw/include/stddef.h b/winsup/mingw/include/stddef.h
index ef9d5ffe4..37403a4b6 100644
--- a/winsup/mingw/include/stddef.h
+++ b/winsup/mingw/include/stddef.h
@@ -1,6 +1,6 @@
/*
* This is just an RC_INVOKED guard for the real stddef.h
- * fixincluded in gcc system dir. One day we will delete this file.
+ * included in gcc system dir. One day we will delete this file.
*/
#ifndef RC_INVOKED
#include_next<stddef.h>
diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h
index 65c4a4b7a..95f61ecb8 100644
--- a/winsup/mingw/include/stdio.h
+++ b/winsup/mingw/include/stdio.h
@@ -197,42 +197,47 @@ __BEGIN_CSTD_NAMESPACE
/*
* File Operations
*/
-FILE* fopen (const char*, const char*);
-FILE* freopen (const char*, const char*, FILE*);
-int fflush (FILE*);
-int fclose (FILE*);
+_CRTIMP FILE* __cdecl fopen (const char*, const char*);
+_CRTIMP FILE* __cdecl freopen (const char*, const char*, FILE*);
+_CRTIMP int __cdecl fflush (FILE*);
+_CRTIMP int __cdecl fclose (FILE*);
/* MS puts remove & rename (but not wide versions) in io.h also */
-int remove (const char*);
-int rename (const char*, const char*);
-FILE* tmpfile (void);
-char* tmpnam (char*);
+_CRTIMP int __cdecl remove (const char*);
+_CRTIMP int __cdecl rename (const char*, const char*);
+_CRTIMP FILE* __cdecl tmpfile (void);
+_CRTIMP char* __cdecl tmpnam (char*);
-int setvbuf (FILE*, char*, int, size_t);
+_CRTIMP int __cdecl setvbuf (FILE*, char*, int, size_t);
-void setbuf (FILE*, char*);
+_CRTIMP void __cdecl setbuf (FILE*, char*);
/*
* Formatted Output
*/
-int fprintf (FILE*, const char*, ...);
-int printf (const char*, ...);
-int sprintf (char*, const char*, ...);
-int vfprintf (FILE*, const char*, __VALIST);
-int vprintf (const char*, __VALIST);
-int vsprintf (char*, const char*, __VALIST);
+_CRTIMP int __cdecl fprintf (FILE*, const char*, ...);
+_CRTIMP int __cdecl printf (const char*, ...);
+_CRTIMP int __cdecl sprintf (char*, const char*, ...);
+_CRTIMP int __cdecl vfprintf (FILE*, const char*, __VALIST);
+_CRTIMP int __cdecl vprintf (const char*, __VALIST);
+_CRTIMP int __cdecl vsprintf (char*, const char*, __VALIST);
__END_CSTD_NAMESPACE
__BEGIN_CGLOBAL_NAMESPACE
-int _snprintf (char*, __CSTD size_t, const char*, ...);
-int _vsnprintf (char*, __CSTD size_t, const char*, __VALIST);
+_CRTIMP int __cdecl _snprintf (char*, __CSTD size_t, const char*, ...);
+_CRTIMP int __cdecl _vsnprintf (char*, __CSTD size_t, const char*, __VALIST);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int snprintf(char* s, __CSTD size_t, const char*, ...);
extern __inline__ int
vsnprintf (char* __s, __CSTD size_t __n, const char* __format, __VALIST __arg)
{ return _vsnprintf ( __s, __n, __format, __arg); }
+int __cdecl vscanf (const char * __restrict__, __VALIST);
+int __cdecl vfscanf (__CSTD FILE * __restrict__, const char * __restrict__,
+ __VALIST);
+int __cdecl vsscanf (const char * __restrict__,
+ const char * __restrict__, __VALIST);
#endif
__END_CGLOBAL_NAMESPACE
@@ -242,91 +247,91 @@ __BEGIN_CSTD_NAMESPACE
* Formatted Input
*/
-int fscanf (FILE*, const char*, ...);
-int scanf (const char*, ...);
-int sscanf (const char*, const char*, ...);
+_CRTIMP int __cdecl fscanf (FILE*, const char*, ...);
+_CRTIMP int __cdecl scanf (const char*, ...);
+_CRTIMP int __cdecl sscanf (const char*, const char*, ...);
/*
* Character Input and Output Functions
*/
-int fgetc (FILE*);
-char* fgets (char*, int, FILE*);
-int fputc (int, FILE*);
-int fputs (const char*, FILE*);
-int getc (FILE*);
-int getchar (void);
-char* gets (char*);
-int putc (int, FILE*);
-int putchar (int);
-int puts (const char*);
-int ungetc (int, FILE*);
+_CRTIMP int __cdecl fgetc (FILE*);
+_CRTIMP char* __cdecl fgets (char*, int, FILE*);
+_CRTIMP int __cdecl fputc (int, FILE*);
+_CRTIMP int __cdecl fputs (const char*, FILE*);
+_CRTIMP int __cdecl getc (FILE*);
+_CRTIMP int __cdecl getchar (void);
+_CRTIMP char* __cdecl gets (char*);
+_CRTIMP int __cdecl putc (int, FILE*);
+_CRTIMP int __cdecl putchar (int);
+_CRTIMP int __cdecl puts (const char*);
+_CRTIMP int __cdecl ungetc (int, FILE*);
/*
* Direct Input and Output Functions
*/
-size_t fread (void*, size_t, size_t, FILE*);
-size_t fwrite (const void*, size_t, size_t, FILE*);
+_CRTIMP size_t __cdecl fread (void*, size_t, size_t, FILE*);
+_CRTIMP size_t __cdecl fwrite (const void*, size_t, size_t, FILE*);
/*
* File Positioning Functions
*/
-int fseek (FILE*, long, int);
-long ftell (FILE*);
-void rewind (FILE*);
+_CRTIMP int __cdecl fseek (FILE*, long, int);
+_CRTIMP long __cdecl ftell (FILE*);
+_CRTIMP void __cdecl rewind (FILE*);
-int fgetpos (FILE*, fpos_t*);
-int fsetpos (FILE*, const fpos_t*);
+_CRTIMP int __cdecl fgetpos (FILE*, fpos_t*);
+_CRTIMP int __cdecl fsetpos (FILE*, const fpos_t*);
/*
* Error Functions
*/
-void clearerr (FILE*);
-int feof (FILE*);
-int ferror (FILE*);
-void perror (const char*);
+_CRTIMP void __cdecl clearerr (FILE*);
+_CRTIMP int __cdecl feof (FILE*);
+_CRTIMP int __cdecl ferror (FILE*);
+_CRTIMP void __cdecl perror (const char*);
__END_CSTD_NAMESPACE
__BEGIN_CGLOBAL_NAMESPACE
#ifndef __STRICT_ANSI__
-char* _tempnam (const char*, const char*);
+_CRTIMP char* __cdecl _tempnam (const char*, const char*);
#ifndef NO_OLDNAMES
-char* tempnam (const char*, const char*);
+_CRTIMP char* __cdecl tempnam (const char*, const char*);
#endif
/*
* Pipes
*/
-__CSTD FILE* _popen (const char*, const char*);
-int _pclose (__CSTD FILE*);
+_CRTIMP __CSTD FILE* __cdecl _popen (const char*, const char*);
+_CRTIMP int __cdecl _pclose (__CSTD FILE*);
#ifndef NO_OLDNAMES
-__CSTD FILE* popen (const char*, const char*);
-int pclose (__CSTD FILE*);
+_CRTIMP __CSTD FILE* __cdecl popen (const char*, const char*);
+_CRTIMP int __cdecl pclose (__CSTD FILE*);
#endif
/*
* Other Non ANSI functions
*/
-int _flushall (void);
-int _fgetchar (void);
-int _fputchar (int);
-__CSTD FILE* _fdopen (int, const char*);
-int _fileno (__CSTD FILE*);
-int _fcloseall(void);
+_CRTIMP int __cdecl _flushall (void);
+_CRTIMP int __cdecl _fgetchar (void);
+_CRTIMP int __cdecl _fputchar (int);
+_CRTIMP __CSTD FILE* __cdecl _fdopen (int, const char*);
+_CRTIMP int __cdecl _fileno (__CSTD FILE*);
+_CRTIMP int __cdecl _fcloseall(void);
#ifdef __MSVCRT__
-int _getmaxstdio(void);
-int _setmaxstdio(int);
+_CRTIMP int __cdecl _getmaxstdio(void);
+_CRTIMP int __cdecl _setmaxstdio(int);
#endif
#ifndef _NO_OLDNAMES
-int fgetchar (void);
-int fputchar (int);
-__CSTD FILE* fdopen (int, const char*);
-int fileno (__CSTD FILE*);
+_CRTIMP int __cdecl fgetchar (void);
+_CRTIMP int __cdecl fputchar (int);
+_CRTIMP __CSTD FILE* __cdecl fdopen (int, const char*);
+_CRTIMP int __cdecl fileno (__CSTD FILE*);
#endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */
@@ -339,25 +344,25 @@ __END_CGLOBAL_NAMESPACE
__BEGIN_CSTD_NAMESPACE
/* also in wchar.h - keep in sync */
-int fwprintf (FILE*, const wchar_t*, ...);
-int wprintf (const wchar_t*, ...);
-int swprintf (wchar_t*, const wchar_t*, ...);
-int vfwprintf (FILE*, const wchar_t*, __VALIST);
-int vwprintf (const wchar_t*, __VALIST);
-int vswprintf (wchar_t*, const wchar_t*, __VALIST);
-int fwscanf (FILE*, const wchar_t*, ...);
-int wscanf (const wchar_t*, ...);
-int swscanf (const wchar_t*, const wchar_t*, ...);
-wint_t fgetwc (FILE*);
-wint_t fputwc (wchar_t, FILE*);
-wint_t ungetwc (wchar_t, FILE*);
+_CRTIMP int __cdecl fwprintf (FILE*, const wchar_t*, ...);
+_CRTIMP int __cdecl wprintf (const wchar_t*, ...);
+_CRTIMP int __cdecl swprintf (wchar_t*, const wchar_t*, ...);
+_CRTIMP int __cdecl vfwprintf (FILE*, const wchar_t*, __VALIST);
+_CRTIMP int __cdecl vwprintf (const wchar_t*, __VALIST);
+_CRTIMP int __cdecl vswprintf (wchar_t*, const wchar_t*, __VALIST);
+_CRTIMP int __cdecl fwscanf (FILE*, const wchar_t*, ...);
+_CRTIMP int __cdecl wscanf (const wchar_t*, ...);
+_CRTIMP int __cdecl swscanf (const wchar_t*, const wchar_t*, ...);
+_CRTIMP wint_t __cdecl fgetwc (FILE*);
+_CRTIMP wint_t __cdecl fputwc (wchar_t, FILE*);
+_CRTIMP wint_t __cdecl ungetwc (wchar_t, FILE*);
#ifdef __MSVCRT__
-wchar_t* fgetws (wchar_t*, int, FILE*);
-int fputws (const wchar_t*, FILE*);
-wint_t getwc (FILE*);
-wint_t getwchar (void);
-wint_t putwc (wint_t, FILE*);
-wint_t putwchar (wint_t);
+_CRTIMP wchar_t* __cdecl fgetws (wchar_t*, int, FILE*);
+_CRTIMP int __cdecl fputws (const wchar_t*, FILE*);
+_CRTIMP wint_t __cdecl getwc (FILE*);
+_CRTIMP wint_t __cdecl getwchar (void);
+_CRTIMP wint_t __cdecl putwc (wint_t, FILE*);
+_CRTIMP wint_t __cdecl putwchar (wint_t);
#endif
__END_CSTD_NAMESPACE
@@ -365,30 +370,36 @@ __BEGIN_CGLOBAL_NAMESPACE
#ifdef __MSVCRT__
#ifndef __STRICT_ANSI__
-wchar_t* _getws (wchar_t*);
-int _putws (const wchar_t*);
-__CSTD FILE* _wfdopen(int, wchar_t *);
-__CSTD FILE* _wfopen (const wchar_t*, const wchar_t*);
-__CSTD FILE* _wfreopen (const wchar_t*, const wchar_t*, __CSTD FILE*);
-__CSTD FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
-wchar_t* _wtmpnam (wchar_t*);
-wchar_t* _wtempnam (const wchar_t*, const wchar_t*);
-int _wrename (const wchar_t*, const wchar_t*);
-int _wremove (const wchar_t*);
-void _wperror (const wchar_t*);
-__CSTD FILE* _wpopen (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl _getws (wchar_t*);
+_CRTIMP int __cdecl _putws (const wchar_t*);
+_CRTIMP __CSTD FILE* __cdecl __cdecl _wfdopen(int, wchar_t *);
+_CRTIMP __CSTD FILE* __cdecl _wfopen (const wchar_t*, const wchar_t*);
+_CRTIMP __CSTD FILE* __cdecl _wfreopen (const wchar_t*, const wchar_t*, __CSTD FILE*);
+_CRTIMP __CSTD FILE* __cdecl _wfsopen (const wchar_t*, const wchar_t*, int);
+_CRTIMP wchar_t* __cdecl _wtmpnam (wchar_t*);
+_CRTIMP wchar_t* __cdecl _wtempnam (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl _wrename (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl _wremove (const wchar_t*);
+_CRTIMP void __cdecl _wperror (const wchar_t*);
+_CRTIMP __CSTD FILE* __cdecl _wpopen (const wchar_t*, const wchar_t*);
#endif /* Not __STRICT_ANSI__ */
#endif /* __MSVCRT__ */
/* C99 names, but non-standard behaviour */
-int _snwprintf (wchar_t*, __CSTD size_t, const wchar_t*, ...);
-int _vsnwprintf (wchar_t*, __CSTD size_t, const wchar_t*, __VALIST);
+_CRTIMP int __cdecl _snwprintf (wchar_t*, __CSTD size_t, const wchar_t*, ...);
+_CRTIMP int __cdecl _vsnwprintf (wchar_t*, __CSTD size_t, const wchar_t*, __VALIST);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
-int snwprintf(wchar_t* s, __CSTD size_t n, const wchar_t* format, ...);
-extern __inline__ int
+int __cdecl snwprintf (wchar_t* s, __CSTD size_t n, const wchar_t* format, ...);
+extern __inline__ int __cdecl
vsnwprintf (wchar_t* __s, __CSTD size_t __n, const wchar_t* __format,
__VALIST __arg)
{ return _vsnwprintf ( __s, __n, __format, __arg);}
+
+int __cdecl vwscanf (const wchar_t * __restrict__, __VALIST);
+int __cdecl vfwscanf (__CSTD FILE * __restrict__,
+ const wchar_t * __restrict__, __VALIST);
+int __cdecl vswscanf (const wchar_t * __restrict__,
+ const wchar_t * __restrict__, __VALIST);
#endif
__END_CGLOBAL_NAMESPACE
@@ -401,23 +412,23 @@ __BEGIN_CGLOBAL_NAMESPACE
#ifndef __STRICT_ANSI__
#ifdef __MSVCRT__
#ifndef NO_OLDNAMES
-__CSTD FILE* wpopen (const wchar_t*, const wchar_t*);
+_CRTIMP __CSTD FILE* __cdecl wpopen (const wchar_t*, const wchar_t*);
#endif /* not NO_OLDNAMES */
#endif /* MSVCRT runtime */
/*
* Other Non ANSI wide functions
*/
-__CSTD wint_t _fgetwchar (void);
-__CSTD wint_t _fputwchar (__CSTD wint_t);
-int _getw (__CSTD FILE*);
-int _putw (int, __CSTD FILE*);
+_CRTIMP __CSTD wint_t __cdecl _fgetwchar (void);
+_CRTIMP __CSTD wint_t __cdecl _fputwchar (__CSTD wint_t);
+_CRTIMP int __cdecl _getw (__CSTD FILE*);
+_CRTIMP int __cdecl _putw (int, __CSTD FILE*);
#ifndef _NO_OLDNAMES
-__CSTD wint_t fgetwchar (void);
-__CSTD wint_t fputwchar (__CSTD wint_t);
-int getw (__CSTD FILE*);
-int putw (int, __CSTD FILE*);
+_CRTIMP __CSTD wint_t __cdecl fgetwchar (void);
+_CRTIMP __CSTD wint_t __cdecl fputwchar (__CSTD wint_t);
+_CRTIMP int __cdecl getw (__CSTD FILE*);
+_CRTIMP int __cdecl putw (int, __CSTD FILE*);
#endif /* Not _NO_OLDNAMES */
#ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */
@@ -425,8 +436,8 @@ int putw (int, __CSTD FILE*);
* Workaround for limitations on win9x where a file contents are
* not zero'd out if you seek past the end and then write.
*/
-int __mingw_fseek (__CSTD FILE *, long, int);
-int __mingw_fwrite (const void*, __CSTD size_t, __CSTD size_t, __CSTD FILE*);
+int __cdecl __mingw_fseek (__CSTD FILE *, long, int);
+int __cdecl __mingw_fwrite (const void*, __CSTD size_t, __CSTD size_t, __CSTD FILE*);
#define fseek(fp, offset, whence) __mingw_fseek(fp, offset, whence)
#define fwrite(buffer, size, count, fp) __mingw_fwrite(buffer, size, count, fp)
#endif /* __USE_MINGW_FSEEK */
diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h
index 58a8904c4..51279ae75 100644
--- a/winsup/mingw/include/stdlib.h
+++ b/winsup/mingw/include/stdlib.h
@@ -87,9 +87,9 @@ extern char** _argv;
/* imports from runtime dll of the above variables */
#ifdef __MSVCRT__
-extern int* __p___argc(void);
-extern char*** __p___argv(void);
-extern wchar_t*** __p___wargv(void);
+_CRTIMP int* __cdecl __p___argc(void);
+_CRTIMP char*** __cdecl __p___argv(void);
+_CRTIMP wchar_t*** __cdecl __p___wargv(void);
#define __argc (*__p___argc())
#define __argv (*__p___argv())
@@ -147,19 +147,19 @@ __MINGW_IMPORT char** __argv_dll;
#undef errno
extern int errno;
#else
-int* _errno(void);
-#define errno (*_errno())
+ _CRTIMP int* __cdecl _errno(void);
+#define errno (*_errno())
#endif
-int* __doserrno(void);
-#define _doserrno (*__doserrno())
+ _CRTIMP int* __cdecl __doserrno(void);
+#define _doserrno (*__doserrno())
/*
* Use environ from the DLL, not as a global.
*/
#ifdef __MSVCRT__
- extern char *** __p__environ(void);
- extern wchar_t *** __p__wenviron(void);
+_CRTIMP char *** __cdecl __p__environ(void);
+_CRTIMP wchar_t *** __cdecl __p__wenviron(void);
# define _environ (*__p__environ())
# define _wenviron (*__p__wenviron())
#else /* ! __MSVCRT__ */
@@ -219,10 +219,10 @@ __MINGW_IMPORT char* _sys_errlist[];
#ifdef __MSVCRT__
/* msvcrtxx.dll */
-extern unsigned int* __p__osver(void);
-extern unsigned int* __p__winver(void);
-extern unsigned int* __p__winmajor(void);
-extern unsigned int* __p__winminor(void);
+_CRTIMP unsigned __cdecl int* __p__osver(void);
+_CRTIMP unsigned __cdecl int* __p__winver(void);
+_CRTIMP unsigned __cdecl int* __p__winmajor(void);
+_CRTIMP unsigned __cdecl int* __p__winminor(void);
#ifndef __DECLSPEC_SUPPORTED
# define _osver (*__p__osver())
@@ -234,7 +234,7 @@ __MINGW_IMPORT unsigned int _osver;
__MINGW_IMPORT unsigned int _winver;
__MINGW_IMPORT unsigned int _winmajor;
__MINGW_IMPORT unsigned int _winminor;
-#endif __DECLSPEC_SUPPORTED
+#endif /* __DECLSPEC_SUPPORTED */
#else
/* Not msvcrtxx.dll, thus crtdll.dll */
@@ -270,9 +270,9 @@ __MINGW_IMPORT unsigned int _winminor_dll;
#if defined __MSVCRT__
/* although the _pgmptr is exported as DATA,
* be safe and use the access function __p__pgmptr() to get it. */
-char** __p__pgmptr(void);
+_CRTIMP char** __cdecl __p__pgmptr(void);
#define _pgmptr (*__p__pgmptr())
-wchar_t** __p__wpgmptr(void);
+_CRTIMP wchar_t** __cdecl __p__wpgmptr(void);
#define _wpgmptr (*__p__wpgmptr())
#else /* ! __MSVCRT__ */
# ifndef __DECLSPEC_SUPPORTED
@@ -322,72 +322,72 @@ __MINGW_IMPORT int _fmode_dll;
__END_CGLOBAL_NAMESPACE
__BEGIN_CSTD_NAMESPACE
-double atof (const char*);
-int atoi (const char*);
-long atol (const char*);
+_CRTIMP double __cdecl atof (const char*);
+_CRTIMP int __cdecl atoi (const char*);
+_CRTIMP long __cdecl atol (const char*);
-double strtod (const char*, char**);
+_CRTIMP double __cdecl strtod (const char*, char**);
#if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */
-extern __inline__ float strtof (const char *__nptr, char **__endptr)
+extern __inline__ float __cdecl strtof (const char *__nptr, char **__endptr)
{ return (strtod (__nptr, __endptr));}
-long double strtold (const char * __restrict__, char ** __restrict__);
+long double __cdecl strtold (const char * __restrict__, char ** __restrict__);
#endif /* __NO_ISOCEXT */
-long strtol (const char*, char**, int);
-unsigned long strtoul (const char*, char**, int);
+_CRTIMP long __cdecl strtol (const char*, char**, int);
+_CRTIMP unsigned long __cdecl strtoul (const char*, char**, int);
__END_CSTD_NAMESPACE
__BEGIN_CGLOBAL_NAMESPACE
-int _wtoi (const wchar_t *);
-long _wtol (const wchar_t *);
+_CRTIMP int __cdecl _wtoi (const wchar_t *);
+_CRTIMP long __cdecl _wtol (const wchar_t *);
__END_CGLOBAL_NAMESPACE
__BEGIN_CSTD_NAMESPACE
#ifndef _WSTDLIB_DEFINED
/* also declared in wchar.h */
-double wcstod (const wchar_t*, wchar_t**);
+_CRTIMP double __cdecl wcstod (const wchar_t*, wchar_t**);
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
-extern __inline__ float wcstof( const wchar_t *__nptr, wchar_t **__endptr)
+extern __inline__ float __cdecl wcstof (const wchar_t *__nptr, wchar_t **__endptr)
{ return (wcstod(__nptr, __endptr)); }
-long double wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
+long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
#endif /* __NO_ISOCEXT */
-long wcstol (const wchar_t*, wchar_t**, int);
-unsigned long wcstoul (const wchar_t*, wchar_t**, int);
+_CRTIMP long __cdecl wcstol (const wchar_t*, wchar_t**, int);
+_CRTIMP unsigned long __cdecl wcstoul (const wchar_t*, wchar_t**, int);
#define _WSTDLIB_DEFINED
#endif
-size_t wcstombs (char*, const wchar_t*, size_t);
-int wctomb (char*, wchar_t);
+_CRTIMP size_t __cdecl wcstombs (char*, const wchar_t*, size_t);
+_CRTIMP int __cdecl wctomb (char*, wchar_t);
-int mblen (const char*, size_t);
-size_t mbstowcs (wchar_t*, const char*, size_t);
-int mbtowc (wchar_t*, const char*, size_t);
+_CRTIMP int __cdecl mblen (const char*, size_t);
+_CRTIMP size_t __cdecl mbstowcs (wchar_t*, const char*, size_t);
+_CRTIMP int __cdecl mbtowc (wchar_t*, const char*, size_t);
-int rand (void);
-void srand (unsigned int);
+_CRTIMP int __cdecl rand (void);
+_CRTIMP void __cdecl srand (unsigned int);
-void* calloc (size_t, size_t);
-void* malloc (size_t);
-void* realloc (void*, size_t);
-void free (void*);
+_CRTIMP void* __cdecl calloc (size_t, size_t);
+_CRTIMP void* __cdecl malloc (size_t);
+_CRTIMP void* __cdecl realloc (void*, size_t);
+_CRTIMP void __cdecl free (void*);
-void abort (void) _ATTRIB_NORETURN;
-void exit (int) _ATTRIB_NORETURN;
-int atexit (void (*)(void));
+_CRTIMP void __cdecl abort (void) _ATTRIB_NORETURN;
+_CRTIMP void __cdecl exit (int) _ATTRIB_NORETURN;
+int __cdecl atexit (void (*)(void));
-int system (const char*);
-char* getenv (const char*);
+_CRTIMP int __cdecl system (const char*);
+_CRTIMP char* __cdecl getenv (const char*);
-void* bsearch (const void*, const void*, size_t, size_t,
- int (*)(const void*, const void*));
-void qsort (const void*, size_t, size_t,
- int (*)(const void*, const void*));
+_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t,
+ int (*)(const void*, const void*));
+_CRTIMP void __cdecl qsort (void*, size_t, size_t,
+ int (*)(const void*, const void*));
-int abs (int);
-long labs (long);
+_CRTIMP int __cdecl abs (int);
+_CRTIMP long __cdecl labs (long);
/*
* div_t and ldiv_t are structures used to return the results of div and
@@ -400,8 +400,8 @@ long labs (long);
typedef struct { int quot, rem; } div_t;
typedef struct { long quot, rem; } ldiv_t;
-div_t div (int, int);
-ldiv_t ldiv (long, long);
+_CRTIMP div_t __cdecl div (int, int);
+_CRTIMP ldiv_t __cdecl ldiv (long, long);
__END_CSTD_NAMESPACE
__BEGIN_CGLOBAL_NAMESPACE
@@ -412,68 +412,68 @@ __BEGIN_CGLOBAL_NAMESPACE
* NOTE: Officially the three following functions are obsolete. The Win32 API
* functions SetErrorMode, Beep and Sleep are their replacements.
*/
-void _beep (unsigned int, unsigned int);
-void _seterrormode (int);
-void _sleep (unsigned long);
+_CRTIMP void __cdecl _beep (unsigned int, unsigned int);
+_CRTIMP void __cdecl _seterrormode (int);
+_CRTIMP void __cdecl _sleep (unsigned long);
-void _exit (int) _ATTRIB_NORETURN;
+_CRTIMP void __cdecl _exit (int) _ATTRIB_NORETURN;
/* _onexit is MS extension. Use atexit for portability. */
typedef int (* _onexit_t)(void);
_onexit_t _onexit( _onexit_t );
-int _putenv (const char*);
-void _searchenv (const char*, const char*, char*);
+_CRTIMP int __cdecl _putenv (const char*);
+_CRTIMP void __cdecl _searchenv (const char*, const char*, char*);
-char* _ecvt (double, int, int*, int*);
-char* _fcvt (double, int, int*, int*);
-char* _gcvt (double, int, char*);
+_CRTIMP char* __cdecl _ecvt (double, int, int*, int*);
+_CRTIMP char* __cdecl _fcvt (double, int, int*, int*);
+_CRTIMP char* __cdecl _gcvt (double, int, char*);
-void _makepath (char*, const char*, const char*, const char*, const char*);
-void _splitpath (const char*, char*, char*, char*, char*);
-char* _fullpath (char*, const char*, __CSTD size_t);
+_CRTIMP void __cdecl _makepath (char*, const char*, const char*, const char*, const char*);
+_CRTIMP void __cdecl _splitpath (const char*, char*, char*, char*, char*);
+_CRTIMP char* __cdecl _fullpath (char*, const char*, __CSTD size_t);
-char* _itoa (int, char*, int);
-char* _ltoa (long, char*, int);
-char* _ultoa(unsigned long, char*, int);
+_CRTIMP char* __cdecl _itoa (int, char*, int);
+_CRTIMP char* __cdecl _ltoa (long, char*, int);
+_CRTIMP char* __cdecl _ultoa(unsigned long, char*, int);
wchar_t* _itow (int, wchar_t*, int);
-wchar_t* _ltow (long, wchar_t*, int);
-wchar_t* _ultow (unsigned long, wchar_t*, int);
+_CRTIMP wchar_t* __cdecl _ltow (long, wchar_t*, int);
+_CRTIMP wchar_t* __cdecl _ultow (unsigned long, wchar_t*, int);
#ifdef __MSVCRT__
__int64 _atoi64(const char *);
-char* _i64toa(__int64, char *, int);
-char* _ui64toa(unsigned __int64, char *, int);
+_CRTIMP char* __cdecl _i64toa(__int64, char *, int);
+_CRTIMP char* __cdecl _ui64toa(unsigned __int64, char *, int);
__int64 _wtoi64(const wchar_t *);
-wchar_t* _i64tow(__int64, wchar_t *, int);
-wchar_t* _ui64tow(unsigned __int64, wchar_t *, int);
-
-wchar_t* _wgetenv(const wchar_t*);
-int _wputenv(const wchar_t*);
-void _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
-void _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
-void _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
-wchar_t* _wfullpath (wchar_t*, const wchar_t*, __CSTD size_t);
-
-unsigned int _rotl(unsigned int, int);
-unsigned int _rotr(unsigned int, int);
-unsigned long _lrotl(unsigned long, int);
-unsigned long _lrotr(unsigned long, int);
+_CRTIMP wchar_t* __cdecl _i64tow(__int64, wchar_t *, int);
+_CRTIMP wchar_t* __cdecl _ui64tow(unsigned __int64, wchar_t *, int);
+
+_CRTIMP wchar_t* __cdecl _wgetenv(const wchar_t*);
+_CRTIMP int __cdecl _wputenv(const wchar_t*);
+_CRTIMP void __cdecl _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
+_CRTIMP void __cdecl _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
+_CRTIMP void __cdecl _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
+_CRTIMP wchar_t* __cdecl __cdecl _wfullpath (wchar_t*, const wchar_t*, __CSTD size_t);
+
+_CRTIMP unsigned int __cdecl _rotl(unsigned int, int);
+_CRTIMP unsigned int __cdecl _rotr(unsigned int, int);
+_CRTIMP unsigned long __cdecl _lrotl(unsigned long, int);
+_CRTIMP unsigned long __cdecl _lrotr(unsigned long, int);
#endif
#ifndef _NO_OLDNAMES
-int putenv (const char*);
-void searchenv (const char*, const char*, char*);
+_CRTIMP int __cdecl putenv (const char*);
+_CRTIMP void __cdecl searchenv (const char*, const char*, char*);
-char* itoa (int, char*, int);
-char* ltoa (long, char*, int);
+_CRTIMP char* __cdecl itoa (int, char*, int);
+_CRTIMP char* __cdecl ltoa (long, char*, int);
#ifndef _UWIN
-char* ecvt (double, int, int*, int*);
-char* fcvt (double, int, int*, int*);
-char* gcvt (double, int, char*);
+_CRTIMP char* __cdecl ecvt (double, int, int*, int*);
+_CRTIMP char* __cdecl fcvt (double, int, int*, int*);
+_CRTIMP char* __cdecl gcvt (double, int, char*);
#endif /* _UWIN */
#endif /* Not _NO_OLDNAMES */
@@ -484,26 +484,26 @@ char* gcvt (double, int, char*);
#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
-void _Exit(int) _ATTRIB_NORETURN; /* Declare to get noreturn attribute. */
+void __cdecl _Exit(int) _ATTRIB_NORETURN; /* Declare to get noreturn attribute. */
#ifndef __STRICT_ANSI__ /* inline using non-ANSI exit */
extern __inline__ void _Exit(int __status)
{ __CGLOBAL _exit(__status); }
#endif
typedef struct { long long quot, rem; } lldiv_t;
-lldiv_t lldiv (long long, long long);
+lldiv_t __cdecl lldiv (long long, long long);
-extern __inline__ long long llabs(long long __j)
+extern __inline__ long long __cdecl llabs(long long __j)
{return (__j >= 0 ? __j : -__j);}
-long long strtoll (const char* __restrict__, char** __restrict, int);
-unsigned long long strtoull (const char* __restrict__, char** __restrict__, int);
+long long __cdecl strtoll (const char* __restrict__, char** __restrict, int);
+unsigned long long __cdecl strtoull (const char* __restrict__, char** __restrict__, int);
#if defined (__MSVCRT__) /* stub for MS _i64 versions */
-long long atoll (const char *);
+long long __cdecl atoll (const char *);
#if !defined (__STRICT_ANSI__)
/* inline using non-ansi function */
-extern __inline__ long long atoll (const char * __c)
+extern __inline__ long long __cdecl atoll (const char * __c)
{ return __CGLOBAL _atoi64 (__c); }
#endif
#endif
@@ -514,23 +514,23 @@ extern __inline__ long long atoll (const char * __c)
#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
#if !defined (__STRICT_ANSI__)
-char* lltoa(long long, char *, int);
-char* ulltoa(unsigned long long , char *, int);
+char* __cdecl lltoa(long long, char *, int);
+char* __cdecl ulltoa(unsigned long long , char *, int);
-long long wtoll(const wchar_t *);
-wchar_t* lltow(long long, wchar_t *, int);
-wchar_t* ulltow(unsigned long long, wchar_t *, int);
+long long __cdecl wtoll(const wchar_t *);
+wchar_t* __cdecl lltow(long long, wchar_t *, int);
+wchar_t* __cdecl ulltow(unsigned long long, wchar_t *, int);
/* inline using non-ansi functions */
-extern __inline__ char* lltoa(long long __n, char * __c, int __i)
+extern __inline__ char* __cdecl lltoa(long long __n, char * __c, int __i)
{ return _i64toa (__n, __c, __i); }
-extern __inline__ char* ulltoa(unsigned long long __n, char * __c, int __i)
+extern __inline__ char* __cdecl ulltoa(unsigned long long __n, char * __c, int __i)
{ return _ui64toa (__n, __c, __i); }
-extern __inline__ long long wtoll(const wchar_t * __w)
+extern __inline__ long long __cdecl wtoll(const wchar_t * __w)
{ return _wtoi64 (__w); }
-extern __inline__ wchar_t* lltow(long long __n, wchar_t * __w, int __i)
+extern __inline__ wchar_t* __cdecl lltow(long long __n, wchar_t * __w, int __i)
{ return _i64tow (__n, __w, __i); }
-extern __inline__ wchar_t* ulltow(unsigned long long __n, wchar_t * __w, int __i)
+extern __inline__ wchar_t* __cdecl ulltow(unsigned long long __n, wchar_t * __w, int __i)
{ return _ui64tow (__n, __w, __i); }
#endif /* (__STRICT_ANSI__) */
diff --git a/winsup/mingw/include/string.h b/winsup/mingw/include/string.h
index 678d49918..4b06f9df0 100644
--- a/winsup/mingw/include/string.h
+++ b/winsup/mingw/include/string.h
@@ -46,29 +46,29 @@ __BEGIN_CSTD_NAMESPACE
/*
* Prototypes of the ANSI Standard C library string functions.
*/
-void* memchr (const void*, int, size_t);
-int memcmp (const void*, const void*, size_t);
-void* memcpy (void*, const void*, size_t);
-void* memmove (void*, const void*, size_t);
-void* memset (void*, int, size_t);
-char* strcat (char*, const char*);
-char* strchr (const char*, int);
-int strcmp (const char*, const char*);
-int strcoll (const char*, const char*); /* Compare using locale */
-char* strcpy (char*, const char*);
-size_t strcspn (const char*, const char*);
-char* strerror (int); /* NOTE: NOT an old name wrapper. */
-
-size_t strlen (const char*);
-char* strncat (char*, const char*, size_t);
-int strncmp (const char*, const char*, size_t);
-char* strncpy (char*, const char*, size_t);
-char* strpbrk (const char*, const char*);
-char* strrchr (const char*, int);
-size_t strspn (const char*, const char*);
-char* strstr (const char*, const char*);
-char* strtok (char*, const char*);
-size_t strxfrm (char*, const char*, size_t);
+_CRTIMP void* __cdecl memchr (const void*, int, size_t);
+_CRTIMP int __cdecl memcmp (const void*, const void*, size_t);
+_CRTIMP void* __cdecl memcpy (void*, const void*, size_t);
+_CRTIMP void* __cdecl memmove (void*, const void*, size_t);
+_CRTIMP void* __cdecl memset (void*, int, size_t);
+_CRTIMP char* __cdecl strcat (char*, const char*);
+_CRTIMP char* __cdecl strchr (const char*, int);
+_CRTIMP int __cdecl strcmp (const char*, const char*);
+_CRTIMP int __cdecl strcoll (const char*, const char*); /* Compare using locale */
+_CRTIMP char* __cdecl strcpy (char*, const char*);
+_CRTIMP size_t __cdecl strcspn (const char*, const char*);
+_CRTIMP char* __cdecl strerror (int); /* NOTE: NOT an old name wrapper. */
+
+_CRTIMP size_t __cdecl strlen (const char*);
+_CRTIMP char* __cdecl strncat (char*, const char*, size_t);
+_CRTIMP int __cdecl strncmp (const char*, const char*, size_t);
+_CRTIMP char* __cdecl strncpy (char*, const char*, size_t);
+_CRTIMP char* __cdecl strpbrk (const char*, const char*);
+_CRTIMP char* __cdecl strrchr (const char*, int);
+_CRTIMP size_t __cdecl strspn (const char*, const char*);
+_CRTIMP char* __cdecl strstr (const char*, const char*);
+_CRTIMP char* __cdecl strtok (char*, const char*);
+_CRTIMP size_t __cdecl strxfrm (char*, const char*, size_t);
__END_CSTD_NAMESPACE
#ifndef __STRICT_ANSI__
@@ -76,24 +76,24 @@ __BEGIN_CGLOBAL_NAMESPACE
/*
* Extra non-ANSI functions provided by the CRTDLL library
*/
-char* _strerror (const char *);
-void* _memccpy (void*, const void*, int, __CSTD size_t);
-int _memicmp (const void*, const void*, __CSTD size_t);
-char* _strdup (const char*);
-int _strcmpi (const char*, const char*);
-int _stricmp (const char*, const char*);
-int _stricoll (const char*, const char*);
-char* _strlwr (char*);
-int _strnicmp (const char*, const char*, __CSTD size_t);
-char* _strnset (char*, int, __CSTD size_t);
-char* _strrev (char*);
-char* _strset (char*, int);
-char* _strupr (char*);
-void _swab (const char*, char*, __CSTD size_t);
+_CRTIMP char* __cdecl _strerror (const char *);
+_CRTIMP void* __cdecl _memccpy (void*, const void*, int, __CSTD size_t);
+_CRTIMP int __cdecl _memicmp (const void*, const void*, __CSTD size_t);
+_CRTIMP char* __cdecl _strdup (const char*);
+_CRTIMP int __cdecl _strcmpi (const char*, const char*);
+_CRTIMP int __cdecl _stricmp (const char*, const char*);
+_CRTIMP int __cdecl _stricoll (const char*, const char*);
+_CRTIMP char* __cdecl _strlwr (char*);
+_CRTIMP int __cdecl _strnicmp (const char*, const char*, __CSTD size_t);
+_CRTIMP char* __cdecl _strnset (char*, int, __CSTD size_t);
+_CRTIMP char* __cdecl _strrev (char*);
+_CRTIMP char* __cdecl _strset (char*, int);
+_CRTIMP char* __cdecl _strupr (char*);
+_CRTIMP void __cdecl _swab (const char*, char*, __CSTD size_t);
#ifdef __MSVCRT__
-int _strncoll(const char*, const char*, __CSTD size_t);
-int _strnicoll(const char*, const char*, __CSTD size_t);
+_CRTIMP int __cdecl _strncoll(const char*, const char*, __CSTD size_t);
+_CRTIMP int __cdecl _strnicoll(const char*, const char*, __CSTD size_t);
#endif
#ifndef _NO_OLDNAMES
@@ -104,28 +104,28 @@ int _strnicoll(const char*, const char*, __CSTD size_t);
* strcasecmp.
*/
-void* memccpy (void*, const void*, int, __CSTD size_t);
-int memicmp (const void*, const void*, __CSTD size_t);
-char* strdup (const char*);
-int strcmpi (const char*, const char*);
-int stricmp (const char*, const char*);
-extern __inline__ int
+_CRTIMP void* __cdecl memccpy (void*, const void*, int, __CSTD size_t);
+_CRTIMP int __cdecl memicmp (const void*, const void*, __CSTD size_t);
+_CRTIMP char* __cdecl strdup (const char*);
+_CRTIMP int __cdecl strcmpi (const char*, const char*);
+_CRTIMP int __cdecl stricmp (const char*, const char*);
+extern __inline__ int __cdecl
strcasecmp (const char * __sz1, const char * __sz2)
{return _stricmp (__sz1, __sz2);}
-int stricoll (const char*, const char*);
-char* strlwr (char*);
-int strnicmp (const char*, const char*, __CSTD size_t);
-extern __inline__ int
+_CRTIMP int __cdecl stricoll (const char*, const char*);
+_CRTIMP char* __cdecl strlwr (char*);
+_CRTIMP int __cdecl strnicmp (const char*, const char*, __CSTD size_t);
+extern __inline__ int __cdecl
strncasecmp (const char*, const char*, __CSTD size_t);
-extern __inline__ int
+extern __inline__ int __cdecl
strncasecmp (const char * __sz1, const char * __sz2, __CSTD size_t __sizeMaxCompare)
{return _strnicmp (__sz1, __sz2, __sizeMaxCompare);}
-char* strnset (char*, int, __CSTD size_t);
-char* strrev (char*);
-char* strset (char*, int);
-char* strupr (char*);
+_CRTIMP char* __cdecl strnset (char*, int, __CSTD size_t);
+_CRTIMP char* __cdecl strrev (char*);
+_CRTIMP char* __cdecl strset (char*, int);
+_CRTIMP char* __cdecl strupr (char*);
#ifndef _UWIN
-void swab (const char*, char*, __CSTD size_t);
+_CRTIMP void __cdecl swab (const char*, char*, __CSTD size_t);
#endif /* _UWIN */
#endif /* Not _NO_OLDNAMES */
@@ -141,23 +141,23 @@ __END_CGLOBAL_NAMESPACE
* Also in wchar.h, where they really belong.
*/
__BEGIN_CSTD_NAMESPACE
-wchar_t* wcscat (wchar_t*, const wchar_t*);
-wchar_t* wcschr (const wchar_t*, wchar_t);
-int wcscmp (const wchar_t*, const wchar_t*);
-int wcscoll (const wchar_t*, const wchar_t*);
-wchar_t* wcscpy (wchar_t*, const wchar_t*);
-size_t wcscspn (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcscat (wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcschr (const wchar_t*, wchar_t);
+_CRTIMP int __cdecl wcscmp (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl wcscoll (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcscpy (wchar_t*, const wchar_t*);
+_CRTIMP size_t __cdecl wcscspn (const wchar_t*, const wchar_t*);
/* Note: No wcserror in CRTDLL. */
-size_t wcslen (const wchar_t*);
-wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
-int wcsncmp(const wchar_t*, const wchar_t*, size_t);
-wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
-wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
-wchar_t* wcsrchr(const wchar_t*, wchar_t);
-size_t wcsspn(const wchar_t*, const wchar_t*);
-wchar_t* wcsstr(const wchar_t*, const wchar_t*);
-wchar_t* wcstok(wchar_t*, const wchar_t*);
-size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
+_CRTIMP size_t __cdecl wcslen (const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsncat (wchar_t*, const wchar_t*, size_t);
+_CRTIMP int __cdecl wcsncmp(const wchar_t*, const wchar_t*, size_t);
+_CRTIMP wchar_t* __cdecl wcsncpy(wchar_t*, const wchar_t*, size_t);
+_CRTIMP wchar_t* __cdecl wcspbrk(const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsrchr(const wchar_t*, wchar_t);
+_CRTIMP size_t __cdecl wcsspn(const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsstr(const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcstok(wchar_t*, const wchar_t*);
+_CRTIMP size_t __cdecl wcsxfrm(wchar_t*, const wchar_t*, size_t);
__END_CSTD_NAMESPACE
#ifndef __STRICT_ANSI__
@@ -169,35 +169,35 @@ __BEGIN_CGLOBAL_NAMESPACE
/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
#define _wcscmpi _wcsicmp
-wchar_t* _wcsdup (const wchar_t*);
-int _wcsicmp (const wchar_t*, const wchar_t*);
-int _wcsicoll (const wchar_t*, const wchar_t*);
-wchar_t* _wcslwr (wchar_t*);
-extern __inline__ int
+_CRTIMP wchar_t* __cdecl _wcsdup (const wchar_t*);
+_CRTIMP int __cdecl _wcsicmp (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl _wcsicoll (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl _wcslwr (wchar_t*);
+extern __inline__ int __cdecl
wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2)
{return _wcsicmp (__ws1, __ws2);}
-wchar_t* _wcsnset (wchar_t*, wchar_t, __CSTD size_t);
-wchar_t* _wcsrev (wchar_t*);
-wchar_t* _wcsset (wchar_t*, wchar_t);
-wchar_t* _wcsupr (wchar_t*);
+_CRTIMP wchar_t* __cdecl _wcsnset (wchar_t*, wchar_t, __CSTD size_t);
+_CRTIMP wchar_t* __cdecl _wcsrev (wchar_t*);
+_CRTIMP wchar_t* __cdecl _wcsset (wchar_t*, wchar_t);
+_CRTIMP wchar_t* __cdecl _wcsupr (wchar_t*);
#ifdef __MSVCRT__
-int _wcsncoll(const wchar_t*, const wchar_t*, __CSTD size_t);
-int _wcsnicoll(const wchar_t*, const wchar_t*, __CSTD size_t);
+_CRTIMP int __cdecl _wcsncoll(const wchar_t*, const wchar_t*, __CSTD size_t);
+_CRTIMP int __cdecl _wcsnicoll(const wchar_t*, const wchar_t*, __CSTD size_t);
#endif
#ifndef __NO_OLDNAMES
/* NOTE: There is no _wcscmpi, but this is for compatibility. */
-int wcscmpi (const wchar_t*, const wchar_t*);
-wchar_t* wcsdup (wchar_t*);
-int wcsicmp (const wchar_t*, const wchar_t*);
-int wcsicoll (const wchar_t*, const wchar_t*);
-wchar_t* wcslwr (wchar_t*);
-int wcsnicmp (const wchar_t*, const wchar_t*, __CSTD size_t);
-wchar_t* wcsnset (wchar_t*, wchar_t, __CSTD size_t);
-wchar_t* wcsrev (wchar_t*);
-wchar_t* wcsset (wchar_t*, wchar_t);
-wchar_t* wcsupr (wchar_t*);
+_CRTIMP int __cdecl wcscmpi (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsdup (wchar_t*);
+_CRTIMP int __cdecl wcsicmp (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl wcsicoll (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcslwr (wchar_t*);
+_CRTIMP int __cdecl wcsnicmp (const wchar_t*, const wchar_t*, __CSTD size_t);
+_CRTIMP wchar_t* __cdecl wcsnset (wchar_t*, wchar_t, __CSTD size_t);
+_CRTIMP wchar_t* __cdecl wcsrev (wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsset (wchar_t*, wchar_t);
+_CRTIMP wchar_t* __cdecl wcsupr (wchar_t*);
#endif /* Not _NO_OLDNAMES */
__END_CGLOBAL_NAMESPACE
diff --git a/winsup/mingw/include/sys/param.h b/winsup/mingw/include/sys/param.h
index 0d55c5512..5ff4c8779 100644
--- a/winsup/mingw/include/sys/param.h
+++ b/winsup/mingw/include/sys/param.h
@@ -33,6 +33,9 @@
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234
#define BYTE_ORDER LITTLE_ENDIAN
+
+#define MAXPATHLEN PATH_MAX
+
#endif
#endif
diff --git a/winsup/mingw/include/sys/stat.h b/winsup/mingw/include/sys/stat.h
index 6b4a25f1f..632034ae3 100644
--- a/winsup/mingw/include/sys/stat.h
+++ b/winsup/mingw/include/sys/stat.h
@@ -154,16 +154,16 @@ struct _stati64 {
extern "C" {
#endif
-int _fstat (int, struct _stat*);
-int _chmod (const char*, int);
-int _stat (const char*, struct _stat*);
+_CRTIMP int __cdecl _fstat (int, struct _stat*);
+_CRTIMP int __cdecl _chmod (const char*, int);
+_CRTIMP int __cdecl _stat (const char*, struct _stat*);
#if defined (__MSVCRT__)
-int _fstati64(int, struct _stati64 *);
-int _stati64(const char *, struct _stati64 *);
+_CRTIMP int __cdecl _fstati64(int, struct _stati64 *);
+_CRTIMP int __cdecl _stati64(const char *, struct _stati64 *);
#if !defined ( _WSTAT_DEFINED) /* also declared in wchar.h */
-int _wstat(const wchar_t*, struct _stat*);
-int _wstati64 (const wchar_t*, struct _stati64*);
+_CRTIMP int __cdecl _wstat(const wchar_t*, struct _stat*);
+_CRTIMP int __cdecl _wstati64 (const wchar_t*, struct _stati64*);
#define _WSTAT_DEFINED
#endif /* _WSTAT_DEFIND */
#endif /* __MSVCRT__ */
@@ -171,9 +171,9 @@ int _wstati64 (const wchar_t*, struct _stati64*);
#ifndef _NO_OLDNAMES
/* These functions live in liboldnames.a. */
-int fstat (int, struct stat*);
-int chmod (const char*, int);
-int stat (const char*, struct stat*);
+_CRTIMP int __cdecl fstat (int, struct stat*);
+_CRTIMP int __cdecl chmod (const char*, int);
+_CRTIMP int __cdecl stat (const char*, struct stat*);
#endif /* Not _NO_OLDNAMES */
diff --git a/winsup/mingw/include/sys/timeb.h b/winsup/mingw/include/sys/timeb.h
index 201116275..16b4dc0a4 100644
--- a/winsup/mingw/include/sys/timeb.h
+++ b/winsup/mingw/include/sys/timeb.h
@@ -64,10 +64,10 @@ extern "C" {
#endif
/* TODO: Not tested. */
-void _ftime (struct _timeb*);
+_CRTIMP void __cdecl _ftime (struct _timeb*);
#ifndef _NO_OLDNAMES
-void ftime (struct timeb*);
+_CRTIMP void __cdecl ftime (struct timeb*);
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
diff --git a/winsup/mingw/include/sys/utime.h b/winsup/mingw/include/sys/utime.h
index d81e2b479..692075536 100644
--- a/winsup/mingw/include/sys/utime.h
+++ b/winsup/mingw/include/sys/utime.h
@@ -65,16 +65,16 @@ struct utimbuf
extern "C" {
#endif
-int _utime (const char*, struct _utimbuf*);
-int _futime (int, struct _utimbuf*);
+_CRTIMP int __cdecl _utime (const char*, struct _utimbuf*);
+_CRTIMP int __cdecl _futime (int, struct _utimbuf*);
/* The wide character version, only available for MSVCRT versions of the
* C runtime library. */
#ifdef __MSVCRT__
-int _wutime (const wchar_t*, struct _utimbuf*);
+_CRTIMP int __cdecl _wutime (const wchar_t*, struct _utimbuf*);
#endif /* MSVCRT runtime */
#ifndef _NO_OLDNAMES
-int utime (const char*, struct utimbuf*);
+_CRTIMP int __cdecl utime (const char*, struct utimbuf*);
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
diff --git a/winsup/mingw/include/time.h b/winsup/mingw/include/time.h
index 5bc85381e..6ec8dd00d 100644
--- a/winsup/mingw/include/time.h
+++ b/winsup/mingw/include/time.h
@@ -88,10 +88,10 @@ struct tm
#define _TM_DEFINED
#endif
-clock_t clock (void);
-time_t time (time_t*);
-double difftime (time_t, time_t);
-time_t mktime (struct tm*);
+_CRTIMP clock_t __cdecl clock (void);
+_CRTIMP time_t __cdecl time (time_t*);
+_CRTIMP double __cdecl difftime (time_t, time_t);
+_CRTIMP time_t __cdecl mktime (struct tm*);
/*
* These functions write to and return pointers to static buffers that may
@@ -103,32 +103,30 @@ time_t mktime (struct tm*);
* Fault and crap out your program. Guess how I know. Hint: stat called on
* a directory gives 'invalid' times in st_atime etc...
*/
-char* asctime (const struct tm*);
-char* ctime (const time_t*);
-struct tm* gmtime (const time_t*);
-struct tm* localtime (const time_t*);
+_CRTIMP char* __cdecl asctime (const struct tm*);
+_CRTIMP char* __cdecl ctime (const time_t*);
+_CRTIMP struct tm* __cdecl gmtime (const time_t*);
+_CRTIMP struct tm* __cdecl localtime (const time_t*);
+_CRTIMP size_t __cdecl strftime (char*, size_t, const char*, const struct tm*);
-size_t strftime (char*, size_t, const char*, const struct tm*);
-
-size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
+_CRTIMP size_t __cdecl wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
__END_CSTD_NAMESPACE
__BEGIN_CGLOBAL_NAMESPACE
-#ifndef __STRICT_ANSI__
-extern void _tzset (void);
-
+ #ifndef __STRICT_ANSI__
+extern _CRTIMP void __cdecl _tzset (void);
+
#ifndef _NO_OLDNAMES
-extern void tzset (void);
+extern _CRTIMP void __cdecl tzset (void);
#endif
-size_t strftime(char*, __CSTD size_t, const char*, const struct __CSTD tm*);
-char* _strdate(char*);
-char* _strtime(char*);
-
-#endif /* Not __STRICT_ANSI__ */
-
+_CRTIMP size_t __cdecl strftime(char*, size_t, const char*, const struct tm*);
+_CRTIMP char* __cdecl _strdate(char*);
+_CRTIMP char* __cdecl _strtime(char*);
+
+ #endif /* Not __STRICT_ANSI__ */
/*
* _daylight: non zero if daylight savings time is used.
* _timezone: difference in seconds between GMT and local time.
@@ -138,9 +136,9 @@ char* _strtime(char*);
#ifdef __MSVCRT__
/* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */
-extern int* __p__daylight (void);
-extern long* __p__timezone (void);
-extern char** __p__tzname (void);
+extern _CRTIMP int* __cdecl __p__daylight (void);
+extern _CRTIMP long* __cdecl __p__timezone (void);
+extern _CRTIMP char** __cdecl __p__tzname (void);
__MINGW_IMPORT int _daylight;
__MINGW_IMPORT long _timezone;
@@ -184,10 +182,10 @@ __MINGW_IMPORT char *tzname[2];
/* wide function prototypes, also declared in wchar.h */
-wchar_t * _wasctime(const struct __CSTD tm*);
-wchar_t * _wctime(const __CSTD time_t*);
-wchar_t* _wstrdate(wchar_t*);
-wchar_t* _wstrtime(wchar_t*);
+_CRTIMP wchar_t* __cdecl _wasctime(const struct tm*);
+_CRTIMP wchar_t* __cdecl _wctime(const time_t*);
+_CRTIMP wchar_t* __cdecl _wstrdate(wchar_t*);
+_CRTIMP wchar_t* __cdecl _wstrtime(wchar_t*);
#define _WTIME_DEFINED
#endif /* _WTIME_DEFINED */
diff --git a/winsup/mingw/include/unistd.h b/winsup/mingw/include/unistd.h
index 98934b280..faa205655 100644
--- a/winsup/mingw/include/unistd.h
+++ b/winsup/mingw/include/unistd.h
@@ -5,7 +5,13 @@
*/
#ifndef __STRICT_ANSI__
+
#include <io.h>
#include <process.h>
-#endif
+
+#define __UNISTD_GETOPT__
+#include <getopt.h>
+#undef __UNISTD_GETOPT__
+
+#endif
diff --git a/winsup/mingw/include/wchar.h b/winsup/mingw/include/wchar.h
index 9c6213953..a045753a4 100644
--- a/winsup/mingw/include/wchar.h
+++ b/winsup/mingw/include/wchar.h
@@ -103,25 +103,25 @@ __END_CSTD_NAMESPACE
__BEGIN_CSTD_NAMESPACE
/* also in stdio.h - keep in sync */
-int fwprintf (FILE*, const wchar_t*, ...);
-int wprintf (const wchar_t*, ...);
-int swprintf (wchar_t*, const wchar_t*, ...);
-int vfwprintf (FILE*, const wchar_t*, __VALIST);
-int vwprintf (const wchar_t*, __VALIST);
-int vswprintf (wchar_t*, const wchar_t*, __VALIST);
-int fwscanf (FILE*, const wchar_t*, ...);
-int wscanf (const wchar_t*, ...);
-int swscanf (const wchar_t*, const wchar_t*, ...);
-wint_t fgetwc (FILE*);
-wint_t fputwc (wchar_t, FILE*);
-wint_t ungetwc (wchar_t, FILE*);
+_CRTIMP int __cdecl fwprintf (FILE*, const wchar_t*, ...);
+_CRTIMP int __cdecl wprintf (const wchar_t*, ...);
+_CRTIMP int __cdecl swprintf (wchar_t*, const wchar_t*, ...);
+_CRTIMP int __cdecl vfwprintf (FILE*, const wchar_t*, __VALIST);
+_CRTIMP int __cdecl vwprintf (const wchar_t*, __VALIST);
+_CRTIMP int __cdecl vswprintf (wchar_t*, const wchar_t*, __VALIST);
+_CRTIMP int __cdecl fwscanf (FILE*, const wchar_t*, ...);
+_CRTIMP int __cdecl wscanf (const wchar_t*, ...);
+_CRTIMP int __cdecl swscanf (const wchar_t*, const wchar_t*, ...);
+_CRTIMP wint_t __cdecl fgetwc (FILE*);
+_CRTIMP wint_t __cdecl fputwc (wchar_t, FILE*);
+_CRTIMP wint_t __cdecl ungetwc (wchar_t, FILE*);
#ifdef __MSVCRT__
-wchar_t* fgetws (wchar_t*, int, FILE*);
-int fputws (const wchar_t*, FILE*);
-wint_t getwc (FILE*);
-wint_t getwchar (void);
-wint_t putwc (wint_t, FILE*);
-wint_t putwchar (wint_t);
+_CRTIMP wchar_t* __cdecl fgetws (wchar_t*, int, FILE*);
+_CRTIMP int __cdecl fputws (const wchar_t*, FILE*);
+_CRTIMP wint_t __cdecl getwc (FILE*);
+_CRTIMP wint_t __cdecl getwchar (void);
+_CRTIMP wint_t __cdecl putwc (wint_t, FILE*);
+_CRTIMP wint_t __cdecl putwchar (wint_t);
#endif
__END_CSTD_NAMESPACE
@@ -129,30 +129,35 @@ __BEGIN_CGLOBAL_NAMESPACE
#ifdef __MSVCRT__
#ifndef __STRICT_ANSI__
-wchar_t* _getws (wchar_t*);
-int _putws (const wchar_t*);
-__CSTD FILE* _wfdopen(int, wchar_t *);
-__CSTD FILE* _wfopen (const wchar_t*, const wchar_t*);
-__CSTD FILE* _wfreopen (const wchar_t*, const wchar_t*, __CSTD FILE*);
-__CSTD FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
-wchar_t* _wtmpnam (wchar_t*);
-wchar_t* _wtempnam (const wchar_t*, const wchar_t*);
-int _wrename (const wchar_t*, const wchar_t*);
-int _wremove (const wchar_t*);
-void _wperror (const wchar_t*);
-__CSTD FILE* _wpopen (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl _getws (wchar_t*);
+_CRTIMP int __cdecl _putws (const wchar_t*);
+_CRTIMP __CSTD FILE* _wfdopen(int, wchar_t *);
+_CRTIMP __CSTD FILE* _wfopen (const wchar_t*, const wchar_t*);
+_CRTIMP __CSTD FILE* _wfreopen (const wchar_t*, const wchar_t*, __CSTD FILE*);
+_CRTIMP __CSTD FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
+_CRTIMP wchar_t* __cdecl _wtmpnam (wchar_t*);
+_CRTIMP wchar_t* __cdecl _wtempnam (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl _wrename (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl _wremove (const wchar_t*);
+_CRTIMP void __cdecl _wperror (const wchar_t*);
+_CRTIMP __CSTD FILE* __cdecl _wpopen (const wchar_t*, const wchar_t*);
#endif /* Not __STRICT_ANSI__ */
#endif /* __MSVCRT__ */
/* C99 names, but non-standard behaviour */
-int _snwprintf (wchar_t*, __CSTD size_t, const wchar_t*, ...);
-int _vsnwprintf (wchar_t*, __CSTD size_t, const wchar_t*, __VALIST);
+int __cdecl _snwprintf (wchar_t*, __CSTD size_t, const wchar_t*, ...);
+int __cdecl _vsnwprintf (wchar_t*, __CSTD size_t, const wchar_t*, __VALIST);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
-int snwprintf(wchar_t* s, __CSTD size_t n, const wchar_t* format, ...);
-extern __inline__ int
+int __cdecl snwprintf(wchar_t* s, __CSTD size_t n, const wchar_t* format, ...);
+extern __inline__ int __cdecl
vsnwprintf (wchar_t* __s, __CSTD size_t __n, const wchar_t* __format,
__VALIST __arg)
{ return _vsnwprintf ( __s, __n, __format, __arg);}
+int __cdecl vwscanf (const wchar_t * __restrict__, __VALIST);
+int __cdecl vfwscanf (__CSTD FILE * __restrict__,
+ const wchar_t * __restrict__, __VALIST);
+int __cdecl vswscanf (const wchar_t * __restrict__,
+ const wchar_t * __restrict__, __VALIST);
#endif
__END_CGLOBAL_NAMESPACE
@@ -165,23 +170,23 @@ __END_CGLOBAL_NAMESPACE
* Also in string.h, since MSDN puts them in both headers.
*/
__BEGIN_CSTD_NAMESPACE
-wchar_t* wcscat (wchar_t*, const wchar_t*);
-wchar_t* wcschr (const wchar_t*, wchar_t);
-int wcscmp (const wchar_t*, const wchar_t*);
-int wcscoll (const wchar_t*, const wchar_t*);
-wchar_t* wcscpy (wchar_t*, const wchar_t*);
-size_t wcscspn (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcscat (wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcschr (const wchar_t*, wchar_t);
+_CRTIMP int __cdecl wcscmp (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl wcscoll (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcscpy (wchar_t*, const wchar_t*);
+_CRTIMP size_t __cdeclwcscspn (const wchar_t*, const wchar_t*);
/* Note: No wcserror in CRTDLL. */
-size_t wcslen (const wchar_t*);
-wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
-int wcsncmp(const wchar_t*, const wchar_t*, size_t);
-wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
-wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
-wchar_t* wcsrchr(const wchar_t*, wchar_t);
-size_t wcsspn(const wchar_t*, const wchar_t*);
-wchar_t* wcsstr(const wchar_t*, const wchar_t*);
-wchar_t* wcstok(wchar_t*, const wchar_t*);
-size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
+_CRTIMP size_t __cdecl wcslen (const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsncat (wchar_t*, const wchar_t*, size_t);
+_CRTIMP int __cdecl wcsncmp(const wchar_t*, const wchar_t*, size_t);
+_CRTIMP wchar_t* __cdecl wcsncpy(wchar_t*, const wchar_t*, size_t);
+_CRTIMP wchar_t* __cdecl wcspbrk(const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsrchr(const wchar_t*, wchar_t);
+_CRTIMP size_t __cdeclwcsspn(const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsstr(const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcstok(wchar_t*, const wchar_t*);
+_CRTIMP size_t __cdecl wcsxfrm(wchar_t*, const wchar_t*, size_t);
__END_CSTD_NAMESPACE
#ifndef __STRICT_ANSI__
@@ -191,35 +196,35 @@ __BEGIN_CGLOBAL_NAMESPACE
*/
/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
-#define _wcscmpi _wcsicmp
-
-wchar_t* _wcsdup (const wchar_t*);
-int _wcsicmp (const wchar_t*, const wchar_t*);
-int _wcsicoll (const wchar_t*, const wchar_t*);
-wchar_t* _wcslwr (wchar_t*);
-int _wcsnicmp (const wchar_t*, const wchar_t*, __CSTD size_t);
-wchar_t* _wcsnset (wchar_t*, wchar_t, __CSTD size_t);
-wchar_t* _wcsrev (wchar_t*);
-wchar_t* _wcsset (wchar_t*, wchar_t);
-wchar_t* _wcsupr (wchar_t*);
+#define _wcscmpi _wcsicmp
+
+_CRTIMP wchar_t* __cdecl _wcsdup (const wchar_t*);
+_CRTIMP int __cdecl _wcsicmp (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl _wcsicoll (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl _wcslwr (wchar_t*);
+_CRTIMP int __cdecl _wcsnicmp (const wchar_t*, const wchar_t*, __CSTD size_t);
+_CRTIMP wchar_t* __cdecl _wcsnset (wchar_t*, wchar_t, __CSTD size_t);
+_CRTIMP wchar_t* __cdecl _wcsrev (wchar_t*);
+_CRTIMP wchar_t* __cdecl _wcsset (wchar_t*, wchar_t);
+_CRTIMP wchar_t* __cdecl _wcsupr (wchar_t*);
#ifdef __MSVCRT__
-int _wcsncoll(const wchar_t*, const wchar_t*, __CSTD size_t);
-int _wcsnicoll(const wchar_t*, const wchar_t*, __CSTD size_t);
+_CRTIMP int _wcsncoll(const wchar_t*, const wchar_t*, __CSTD size_t);
+_CRTIMP int _wcsnicoll(const wchar_t*, const wchar_t*, __CSTD size_t);
#endif
#ifndef __NO_OLDNAMES
/* NOTE: There is no _wcscmpi, but this is for compatibility. */
-int wcscmpi (const wchar_t*, const wchar_t*);
-wchar_t* wcsdup (wchar_t*);
-int wcsicmp (const wchar_t*, const wchar_t*);
-int wcsicoll (const wchar_t*, const wchar_t*);
-wchar_t* wcslwr (wchar_t*);
-int wcsnicmp (const wchar_t*, const wchar_t*, __CSTD size_t);
-wchar_t* wcsnset (wchar_t*, wchar_t, __CSTD size_t);
-wchar_t* wcsrev (wchar_t*);
-wchar_t* wcsset (wchar_t*, wchar_t);
-wchar_t* wcsupr (wchar_t*);
+_CRTIMP int __cdecl wcscmpi (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsdup (wchar_t*);
+_CRTIMP int __cdecl wcsicmp (const wchar_t*, const wchar_t*);
+_CRTIMP int __cdecl wcsicoll (const wchar_t*, const wchar_t*);
+_CRTIMP wchar_t* __cdecl wcslwr (wchar_t*);
+_CRTIMP int __cdecl wcsnicmp (const wchar_t*, const wchar_t*, __CSTD size_t);
+_CRTIMP wchar_t* __cdecl wcsnset (wchar_t*, wchar_t, __CSTD size_t);
+_CRTIMP wchar_t* __cdecl wcsrev (wchar_t*);
+_CRTIMP wchar_t* __cdecl wcsset (wchar_t*, wchar_t);
+_CRTIMP wchar_t* __cdecl wcsupr (wchar_t*);
#endif /* Not _NO_OLDNAMES */
__END_CGLOBAL_NAMESPACE
@@ -263,17 +268,17 @@ struct _wfinddatai64_t {
#if !defined (_WIO_DEFINED)
/* Wide character versions from io.h */
#if defined (__MSVCRT__)
-int _waccess(const wchar_t*, int);
-int _wchmod(const wchar_t*, int);
-int _wcreat(const wchar_t*, int);
-long _wfindfirst(const wchar_t*, struct _wfinddata_t*);
-int _wfindnext(long, struct _wfinddata_t *);
-int _wunlink(const wchar_t*);
-int _wopen(const wchar_t*, int, ...);
-int _wsopen(const wchar_t*, int, int, ...);
-wchar_t * _wmktemp(wchar_t*);
-long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
-int _wfindnexti64(long, struct _wfinddatai64_t*);
+_CRTIMP int __cdecl _waccess(const wchar_t*, int);
+_CRTIMP int __cdecl _wchmod(const wchar_t*, int);
+_CRTIMP int __cdecl _wcreat(const wchar_t*, int);
+_CRTIMP long __cdecl _wfindfirst(const wchar_t*, struct _wfinddata_t*);
+_CRTIMP int __cdecl _wfindnext(long, struct _wfinddata_t *);
+_CRTIMP int __cdecl _wunlink(const wchar_t*);
+_CRTIMP int __cdecl _wopen(const wchar_t*, int, ...);
+_CRTIMP int __cdecl _wsopen(const wchar_t*, int, int, ...);
+_CRTIMP wchar_t * __cdecl _wmktemp(wchar_t*);
+_CRTIMP long __cdecl _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
+_CRTIMP int __cdecl _wfindnexti64(long, struct _wfinddatai64_t*);
#ifndef __NO_OLDNAMES
/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */
@@ -298,11 +303,11 @@ wchar_t * wmktemp(wchar_t *);
#ifndef _WDIRECT_DEFINED
/* Also in direct.h */
#ifdef __MSVCRT__
-int _wchdir (const wchar_t*);
-wchar_t* _wgetcwd (wchar_t*, int);
-wchar_t* _wgetdcwd (int, wchar_t*, int);
-int _wmkdir (const wchar_t*);
-int _wrmdir (const wchar_t*);
+_CRTIMP int __cdecl _wchdir (const wchar_t*);
+_CRTIMP wchar_t* __cdecl _wgetcwd (wchar_t*, int);
+_CRTIMP wchar_t* __cdecl _wgetdcwd (int, wchar_t*, int);
+_CRTIMP int __cdecl _wmkdir (const wchar_t*);
+_CRTIMP int __cdecl _wrmdir (const wchar_t*);
#endif /* __MSVCRT__ */
#define _WDIRECT_DEFINED
#endif /* _WDIRECT_DEFINED */
@@ -368,14 +373,14 @@ struct _stati64 {
#if !defined ( _WSTAT_DEFINED)
/* also declared in sys/stat.h */
#if defined __MSVCRT__
-int _wstat (const wchar_t*, struct _stat*);
-int _wstati64 (const wchar_t*, struct _stati64*);
+_CRTIMP int __cdecl _wstat (const wchar_t*, struct _stat*);
+_CRTIMP int __cdecl _wstati64 (const wchar_t*, struct _stati64*);
#endif /* __MSVCRT__ */
#define _WSTAT_DEFINED
#endif /* ! _WSTAT_DEFIND */
#ifndef _WLOCALE_DEFINED /* also declared in locale.h */
-wchar_t* _wsetlocale (int, const wchar_t*);
+_CRTIMP wchar_t* __cdecl _wsetlocale (int, const wchar_t*);
#define _WLOCALE_DEFINED
#endif
__END_CGLOBAL_NAMESPACE
@@ -386,28 +391,28 @@ __BEGIN_CGLOBAL_NAMESPACE
#ifdef __MSVCRT__
#ifndef __STRICT_ANSI__
/* wide function prototypes, also declared in time.h */
-wchar_t* _wasctime (const struct __CSTD tm*);
-wchar_t* _wctime (const __CSTD time_t*);
-wchar_t* _wstrdate (wchar_t*);
-wchar_t* _wstrtime (wchar_t*);
+_CRTIMP wchar_t* __cdecl _wasctime (const struct __CSTD tm*);
+_CRTIMP wchar_t* __cdecl _wctime (const __CSTD time_t*);
+_CRTIMP wchar_t* __cdecl _wstrdate (wchar_t*);
+_CRTIMP wchar_t* __cdecl _wstrtime (wchar_t*);
#endif /* __MSVCRT__ */
#endif /* __STRICT_ANSI__ */
__END_CGLOBAL_NAMESPACE
__BEGIN_CSTD_NAMESPACE
-size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
+_CRTIMP size_t __cdecl wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
__END_CSTD_NAMESPACE
#define _WTIME_DEFINED
#endif /* _WTIME_DEFINED */
#ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */
__BEGIN_CSTD_NAMESPACE
-long wcstol (const wchar_t*, wchar_t**, int);
-unsigned long wcstoul (const wchar_t*, wchar_t**, int);
-double wcstod (const wchar_t*, wchar_t**);
+_CRTIMP long __cdecl wcstol (const wchar_t*, wchar_t**, int);
+_CRTIMP unsigned long __cdecl wcstoul (const wchar_t*, wchar_t**, int);
+_CRTIMP double __cdecl wcstod (const wchar_t*, wchar_t**);
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
-extern __inline__ float wcstof( const wchar_t *__nptr, wchar_t **__endptr)
-{ return (wcstod(__nptr, __endptr)); }
-long double wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
+extern __inline__ float __cdecl wcstof( const wchar_t *__nptr, wchar_t **__endptr)
+ { return (wcstod(__nptr, __endptr)); }
+long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
#endif /* __NO_ISOCEXT */
__END_CSTD_NAMESPACE
#define _WSTDLIB_DEFINED
@@ -425,30 +430,30 @@ typedef int mbstate_t;
/* If you don't have msvcp60.dll in your windows system directory, you can
easily obtain it with a search from your favorite search engine. */
-wint_t btowc(int);
-size_t mbrlen(const char *, size_t, mbstate_t *);
-size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
-size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);
+wint_t __cdecl btowc(int);
+size_t __cdecl mbrlen(const char *, size_t, mbstate_t *);
+size_t __cdecl mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
+size_t __cdecl mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);
-size_t wcrtomb(char *, wchar_t, mbstate_t *);
-size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);
-int wctob(wint_t);
+size_t __cdecl wcrtomb(char *, wchar_t, mbstate_t *);
+size_t __cdecl wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);
+int __cdecl wctob(wint_t);
#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */
extern __inline__ int fwide(FILE* __stream, int __mode)
{return -1;} /* limited to byte orientation */
extern __inline__ int mbsinit(const mbstate_t* __ps)
{return 1;}
-wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
-wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n);
-int wmemcmp(const wchar_t* s1, const wchar_t * s2, size_t n);
-wchar_t* wmemcpy(wchar_t* __restrict__ s1, const wchar_t* __restrict__ s2,
- size_t n);
-wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
-long long wcstoll(const wchar_t* __restrict__ nptr,
- wchar_t** __restrict__ endptr, int base);
-unsigned long long wcstoull(const wchar_t* __restrict__ nptr,
- wchar_t ** __restrict__ endptr, int base);
+wchar_t* __cdecl wmemset(wchar_t* s, wchar_t c, size_t n);
+wchar_t* __cdecl wmemchr(const wchar_t* s, wchar_t c, size_t n);
+int __cdecl wmemcmp(const wchar_t* s1, const wchar_t * s2, size_t n);
+wchar_t* __cdecl wmemcpy(wchar_t* __restrict__ s1, const wchar_t* __restrict__ s2,
+ size_t n);
+wchar_t* __cdecl wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
+long long __cdecl wcstoll(const wchar_t* __restrict__ nptr,
+ wchar_t** __restrict__ endptr, int base);
+unsigned long long __cdecl wcstoull(const wchar_t* __restrict__ nptr,
+ wchar_t ** __restrict__ endptr, int base);
#endif /* __NO_ISOCEXT */
diff --git a/winsup/mingw/include/wctype.h b/winsup/mingw/include/wctype.h
index 781686425..f16360c7a 100644
--- a/winsup/mingw/include/wctype.h
+++ b/winsup/mingw/include/wctype.h
@@ -62,24 +62,24 @@ typedef wchar_t wctype_t;
#endif
/* Wide character equivalents - also in ctype.h */
-int iswalnum(wint_t);
-int iswalpha(wint_t);
-int iswascii(wint_t);
-int iswcntrl(wint_t);
-int iswctype(wint_t, wctype_t);
-int iswdigit(wint_t);
-int iswgraph(wint_t);
-int iswlower(wint_t);
-int iswprint(wint_t);
-int iswpunct(wint_t);
-int iswspace(wint_t);
-int iswupper(wint_t);
-int iswxdigit(wint_t);
-
-wchar_t towlower(wchar_t);
-wchar_t towupper(wchar_t);
-
-int isleadbyte (int);
+_CRTIMP int __cdecl iswalnum(wint_t);
+_CRTIMP int __cdecl iswalpha(wint_t);
+_CRTIMP int __cdecl iswascii(wint_t);
+_CRTIMP int __cdecl iswcntrl(wint_t);
+_CRTIMP int __cdecl iswctype(wint_t, wctype_t);
+_CRTIMP int __cdecl iswdigit(wint_t);
+_CRTIMP int __cdecl iswgraph(wint_t);
+_CRTIMP int __cdecl iswlower(wint_t);
+_CRTIMP int __cdecl iswprint(wint_t);
+_CRTIMP int __cdecl iswpunct(wint_t);
+_CRTIMP int __cdecl iswspace(wint_t);
+_CRTIMP int __cdecl iswupper(wint_t);
+_CRTIMP int __cdecl iswxdigit(wint_t);
+
+_CRTIMP wchar_t __cdecl towlower(wchar_t);
+_CRTIMP wchar_t __cdecl towupper(wchar_t);
+
+_CRTIMP int __cdecl isleadbyte (int);
/* Also in ctype.h */
@@ -104,34 +104,35 @@ extern unsigned short** _imp___ctype;
# endif /* CRTDLL */
#endif /* __DECLSPEC_SUPPORTED */
-#if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
+#if !(defined (__NO_INLINE__) || defined(__NO_CTYPE_INLINES) \
+ || defined(__WCTYPE_INLINES_DEFINED))
#define __WCTYPE_INLINES_DEFINED
-extern __inline__ int iswalnum(wint_t __wc) {return (iswctype(__wc,_ALPHA|_DIGIT));}
-extern __inline__ int iswalpha(wint_t __wc) {return (iswctype(__wc,_ALPHA));}
-extern __inline__ int iswascii(wint_t __wc) {return ((__wc & ~0x7F) == 0);}
-extern __inline__ int iswcntrl(wint_t __wc) {return (iswctype(__wc,_CONTROL));}
-extern __inline__ int iswdigit(wint_t __wc) {return (iswctype(__wc,_DIGIT));}
-extern __inline__ int iswgraph(wint_t __wc) {return (iswctype(__wc,_PUNCT|_ALPHA|_DIGIT));}
-extern __inline__ int iswlower(wint_t __wc) {return (iswctype(__wc,_LOWER));}
-extern __inline__ int iswprint(wint_t __wc) {return (iswctype(__wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
-extern __inline__ int iswpunct(wint_t __wc) {return (iswctype(__wc,_PUNCT));}
-extern __inline__ int iswspace(wint_t __wc) {return (iswctype(__wc,_SPACE));}
-extern __inline__ int iswupper(wint_t __wc) {return (iswctype(__wc,_UPPER));}
-extern __inline__ int iswxdigit(wint_t __wc) {return (iswctype(__wc,_HEX));}
-extern __inline__ int isleadbyte(int __c)
+extern __inline__ int __cdecl iswalnum(wint_t __wc) {return (iswctype(__wc,_ALPHA|_DIGIT));}
+extern __inline__ int __cdecl iswalpha(wint_t __wc) {return (iswctype(__wc,_ALPHA));}
+extern __inline__ int __cdecl iswascii(wint_t __wc) {return ((__wc & ~0x7F) == 0);}
+extern __inline__ int __cdecl iswcntrl(wint_t __wc) {return (iswctype(__wc,_CONTROL));}
+extern __inline__ int __cdecl iswdigit(wint_t __wc) {return (iswctype(__wc,_DIGIT));}
+extern __inline__ int __cdecl iswgraph(wint_t __wc) {return (iswctype(__wc,_PUNCT|_ALPHA|_DIGIT));}
+extern __inline__ int __cdecl iswlower(wint_t __wc) {return (iswctype(__wc,_LOWER));}
+extern __inline__ int __cdecl iswprint(wint_t __wc) {return (iswctype(__wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
+extern __inline__ int __cdecl iswpunct(wint_t __wc) {return (iswctype(__wc,_PUNCT));}
+extern __inline__ int __cdecl iswspace(wint_t __wc) {return (iswctype(__wc,_SPACE));}
+extern __inline__ int __cdecl iswupper(wint_t __wc) {return (iswctype(__wc,_UPPER));}
+extern __inline__ int __cdecl iswxdigit(wint_t __wc) {return (iswctype(__wc,_HEX));}
+extern __inline__ int __cdecl isleadbyte(int __c)
{return (_pctype[(unsigned char)(__c)] & _LEADBYTE);}
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
typedef wchar_t wctrans_t;
-wint_t towctrans(wint_t, wctrans_t);
-wctrans_t wctrans(const char*);
-wctype_t wctype(const char*);
+_CRTIMP wint_t __cdecl towctrans(wint_t, wctrans_t);
+_CRTIMP wctrans_t __cdecl wctrans(const char*);
+_CRTIMP wctype_t __cdecl wctype(const char*);
__END_CSTD_NAMESPACE
#ifndef __STRICT_ANSI__
__BEGIN_CGLOBAL_NAMESPACE
-int is_wctype(__CSTD wint_t, __CSTD wctype_t); /* Obsolete! */
+_CRTIMP int __cdecl is_wctype(__CSTD wint_t, __CSTD wctype_t); /* Obsolete! */
__END_CGLOBAL_NAMESPACE
#endif /* __STRICT_ANSI__ */
diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in
index bb96cac71..f4164d6f8 100644
--- a/winsup/mingw/mingwex/Makefile.in
+++ b/winsup/mingw/mingwex/Makefile.in
@@ -4,7 +4,7 @@
# This makefile requires GNU make.
srcdir = @srcdir@
-VPATH = $(srcdir):$(srcdir)/math
+VPATH = $(srcdir):$(srcdir)/math:$(srcdir)/stdio
objdir = .
target_alias = @target_alias@
@@ -29,12 +29,12 @@ DISTFILES = Makefile.in configure configure.in \
_Exit.c atoll.c dirent.c feclearexcept.c fegetenv.c \
fegetexceptflag.c fegetround.c feholdexcept.c feraiseexcept.c \
fesetenv.c fesetexceptflag.c fesetround.c fetestexcept.c \
- feupdateenv.c fwide.c imaxabs.c imaxdiv.c ldtoa.c lltoa.c lltow.c \
- mbsinit.c mingw-fseek.c sitest.c snprintf.c snwprintf.c \
- strtof.c strtoimax.c strtold.c strtoumax.c testwmem.c \
- ulltoa.c ulltow.c vsnprintf.c vsnwprintf.c wcstof.c \
- wcstoimax.c wcstold.c wcstoumax.c wdirent.c wmemchr.c \
+ feupdateenv.c fwide.c getopt.c imaxabs.c imaxdiv.c ldtoa.c \
+ lltoa.c lltow.c mbsinit.c mingw-fseek.c sitest.c strtof.c \
+ strtoimax.c strtold.c strtoumax.c testwmem.c ulltoa.c ulltow.c \
+ wcstof.c wcstoimax.c wcstold.c wcstoumax.c wdirent.c wmemchr.c \
wmemcmp.c wmemcpy.c wmemmove.c wmemset.c wtoll.c
+
MATH_DISTFILES = \
acosf.c acosl.c asinf.c asinl.c atan2f.c atan2l.c \
atanf.c atanl.c cbrt.c cbrtf.c cbrtl.c ceilf.S ceill.S \
@@ -61,6 +61,10 @@ MATH_DISTFILES = \
sqrtf.c sqrtl.c tanf.S tanhf.c tanhl.c tanl.S tgamma.c \
tgammaf.c tgammal.c trunc.c truncf.c truncl.c
+STDIO_DISTFILES = \
+ snprintf.c snwprintf.c vsnprintf.c vsnwprintf.c \
+ vfscanf.c vfwscanf.c vscanf.c vsscanf.c vswscanf.c vwscanf.c
+
CC = @CC@
# FIXME: Which is it, CC or CC_FOR_TARGET?
CC_FOR_TARGET = $(CC)
@@ -104,8 +108,9 @@ STDLIB_STUB_OBJS = \
atoll.o wtoll.o \
strtof.o wcstof.o \
_Exit.o
-STDIO_STUB_OBJS = \
- snprintf.o vsnprintf.o snwprintf.o vsnwprintf.o
+STDIO_OBJS = \
+ snprintf.o vsnprintf.o snwprintf.o vsnwprintf.o \
+ vfscanf.o vfwscanf.o vscanf.o vsscanf.o vswscanf.o vwscanf.o
MATH_OBJS = \
acosf.o acosl.o asinf.o asinl.o atan2f.o atan2l.o \
atanf.o atanl.o cbrt.o cbrtf.o cbrtl.o ceilf.o ceill.o \
@@ -136,13 +141,13 @@ FENV_OBJS = fesetround.o fegetround.o \
feclearexcept.o feholdexcept.o fegetexceptflag.o \
feraiseexcept.o fetestexcept.o fesetexceptflag.o
POSIX_OBJS = \
- dirent.o wdirent.o
+ dirent.o wdirent.o getopt.o
REPLACE_OBJS = \
mingw-fseek.o
LIB_OBJS = $(Q8_OBJS) $(STDLIB_OBJS) $(STDLIB_STUB_OBJS) \
- $(STDIO_STUB_OBJS) $(MATH_OBJS) $(FENV_OBJS) $(POSIX_OBJS) \
- $(REPLACE_OBJS)
+ $(STDIO_OBJS) $(MATH_OBJS) $(FENV_OBJS) \
+ $(POSIX_OBJS) $(REPLACE_OBJS)
LIBS = $(LIBMINGWEX_A)
DLLS =
@@ -203,8 +208,12 @@ dist:
cp -p $(srcdir)/$$i $(distdir)/mingwex/$$i ; \
done
mkdir $(distdir)/mingwex/math
- chmod 755 $(distdir)//mingwex/math
+ chmod 755 $(distdir)/mingwex/math
@for i in $(MATH_DISTFILES); do\
cp -p $(srcdir)/math/$$i $(distdir)/mingwex/math/$$i ; \
done
-
+ mkdir $(distdir)/mingwex/stdio
+ chmod 755 $(distdir)/mingwex/stdio
+ @for i in $(STDIO_DISTFILES); do\
+ cp -p $(srcdir)/stdio/$$i $(distdir)/mingwex/stdio/$$i ; \
+ done
diff --git a/winsup/mingw/mingwex/dirent.c b/winsup/mingw/mingwex/dirent.c
index 91c170619..cdca6de35 100644
--- a/winsup/mingw/mingwex/dirent.c
+++ b/winsup/mingw/mingwex/dirent.c
@@ -58,7 +58,7 @@ _topendir (const _TCHAR *szPath)
/* Attempt to determine if the given path really is a directory. */
rc = GetFileAttributes (szPath);
- if (rc == -1)
+ if (rc == (unsigned int)-1)
{
/* call GetLastError for more error info */
errno = ENOENT;
diff --git a/winsup/mingw/mingwex/fesetenv.c b/winsup/mingw/mingwex/fesetenv.c
index b3d5c5f05..1e8090cc3 100644
--- a/winsup/mingw/mingwex/fesetenv.c
+++ b/winsup/mingw/mingwex/fesetenv.c
@@ -1,4 +1,5 @@
#include <fenv.h>
+#include <float.h>
/* 7.6.4.3
The fesetenv function establishes the floating-point environment
diff --git a/winsup/mingw/mingwex/math/cephes_emath.h b/winsup/mingw/mingwex/math/cephes_emath.h
index d2f34d78c..c814acdd2 100644
--- a/winsup/mingw/mingwex/math/cephes_emath.h
+++ b/winsup/mingw/mingwex/math/cephes_emath.h
@@ -282,7 +282,6 @@ static __inline__ void __eshdn6(register short unsigned int *x);
#define XPD 0,
/* #define XPD */
#define NANS
-#define INFINITY
/* NaN's require infinity support. */
#ifdef NANS
diff --git a/winsup/mingw/mingwex/math/powl.c b/winsup/mingw/mingwex/math/powl.c
index f066eeaee..2a09ae1e0 100644
--- a/winsup/mingw/mingwex/math/powl.c
+++ b/winsup/mingw/mingwex/math/powl.c
@@ -269,8 +269,17 @@ static const unsigned short R[] = {
#else
#define MNEXP (-NXT*16384.0L)
#endif
-static const unsigned short L[] = {0xc2ef,0x705f,0xeca5,0xe2a8,0x3ffd, XPD};
-#define LOG2EA (*(long double *)(&L[0]))
+static const
+union
+{
+ unsigned short L[6];
+ long double ld;
+} log2ea = {{0xc2ef,0x705f,0xeca5,0xe2a8,0x3ffd, XPD}};
+
+#define LOG2EA (log2ea.ld)
+/*
+#define LOG2EA 0.44269504088896340735992L
+*/
#endif
#ifdef MIEEE
diff --git a/winsup/mingw/mingwex/math/tanhl.c b/winsup/mingw/mingwex/math/tanhl.c
index 3727b3990..d5d86d0ae 100644
--- a/winsup/mingw/mingwex/math/tanhl.c
+++ b/winsup/mingw/mingwex/math/tanhl.c
@@ -68,13 +68,13 @@ static long double Q[] = {
#endif
#ifdef IBMPC
-static short P[] = {
+static unsigned short P[] = {
0xd2a4,0x1b0c,0x8f15,0x8f99,0xbff1, XPD
0x5959,0x9111,0x9cc7,0xf4e2,0xbffe, XPD
0xb576,0xef5e,0x6d57,0xa81b,0xc005, XPD
0xe3be,0xbfbd,0x5cbc,0xa381,0xc009, XPD
};
-static short Q[] = {
+static unsigned short Q[] = {
/*0x0000,0x0000,0x0000,0x8000,0x3fff,*/
0x687f,0xce24,0xdd6c,0xc084,0x4005, XPD
0x3793,0xc95f,0xfa2f,0xe3b9,0x4009, XPD
diff --git a/winsup/mingw/mingwex/math/tgammal.c b/winsup/mingw/mingwex/math/tgammal.c
index 682a12e8e..f3fcdd6d5 100644
--- a/winsup/mingw/mingwex/math/tgammal.c
+++ b/winsup/mingw/mingwex/math/tgammal.c
@@ -88,7 +88,7 @@ static const long double Q[9] = {
};
#endif
#if IBMPC
-static const short P[] = {
+static const unsigned short P[] = {
0x434a,0x3f22,0x2bda,0xb0b2,0x3ff0, XPD
0xf5aa,0xe82f,0x335b,0xee2e,0x3ff3, XPD
0xbe6c,0x3757,0xc717,0x861b,0x3ff7, XPD
@@ -98,7 +98,7 @@ static const short P[] = {
0x29cf,0x19b3,0x16c8,0xd67a,0x3ffe, XPD
0x0000,0x0000,0x0000,0x8000,0x3fff, XPD
};
-static const short Q[] = {
+static const unsigned short Q[] = {
0x5473,0x2de8,0x1268,0xea67,0xbfee, XPD
0x334b,0xc2f0,0xa2dd,0xf60e,0x3ff2, XPD
0xbeed,0x1853,0xa691,0xa23d,0xbff5, XPD
@@ -182,7 +182,7 @@ static const long double STIR[9] = {
};
#endif
#if IBMPC
-static const short STIR[] = {
+static const unsigned short STIR[] = {
0x6ede,0x69f7,0x54e3,0xbb5d,0x3ff4, XPD
0xc395,0x0295,0x4443,0xc64b,0xbfef, XPD
0xba6f,0x7c59,0x5e47,0x9bfb,0xbff4, XPD
diff --git a/winsup/mingw/mingwex/snprintf.c b/winsup/mingw/mingwex/snprintf.c
deleted file mode 100644
index c8d2a7b20..000000000
--- a/winsup/mingw/mingwex/snprintf.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdarg.h>
-#include <stdio.h>
-
-int snprintf(char* buffer, size_t n, const char* format, ...)
-{
- int retval;
- va_list argptr;
-
- va_start( argptr, format );
- retval = _vsnprintf( buffer, n, format, argptr );
- va_end( argptr );
- return retval;
-}
diff --git a/winsup/mingw/mingwex/snwprintf.c b/winsup/mingw/mingwex/snwprintf.c
deleted file mode 100644
index 42b05b292..000000000
--- a/winsup/mingw/mingwex/snwprintf.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#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;
-}
diff --git a/winsup/mingw/mingwex/stdio/vwscanf.c b/winsup/mingw/mingwex/stdio/vwscanf.c
index c8f53eef2..72349c300 100644
--- a/winsup/mingw/mingwex/stdio/vwscanf.c
+++ b/winsup/mingw/mingwex/stdio/vwscanf.c
@@ -2,6 +2,7 @@
// Public domain: all copyrights disclaimed, absolutely no warranties.
#include <stdarg.h>
+#include <stdio.h>
#include <wchar.h>
int vwscanf(const wchar_t * __restrict__ format, va_list arg) {
diff --git a/winsup/mingw/mingwex/strtoimax.c b/winsup/mingw/mingwex/strtoimax.c
index 0cf2c01ed..9072d4bbb 100644
--- a/winsup/mingw/mingwex/strtoimax.c
+++ b/winsup/mingw/mingwex/strtoimax.c
@@ -82,7 +82,7 @@ strtoimax(nptr, endptr, base)
accum = n;
for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr )
- if ( accum > INTMAX_MAX / base + 2 ) /* major wrap-around */
+ if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */
toobig = 1; /* but keep scanning */
else
accum = base * accum + n;
diff --git a/winsup/mingw/mingwex/vsnprintf.c b/winsup/mingw/mingwex/vsnprintf.c
deleted file mode 100644
index f3dce5b67..000000000
--- a/winsup/mingw/mingwex/vsnprintf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <stdarg.h>
-#include <stdio.h>
-
-int vsnprintf (char* s, size_t n, const char* format, va_list arg)
- { return _vsnprintf ( s, n, format, arg); }
diff --git a/winsup/mingw/mingwex/vsnwprintf.c b/winsup/mingw/mingwex/vsnwprintf.c
deleted file mode 100644
index 1b59a078b..000000000
--- a/winsup/mingw/mingwex/vsnwprintf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#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 );}
diff --git a/winsup/mingw/mingwex/wcstoimax.c b/winsup/mingw/mingwex/wcstoimax.c
index 4b82b14a2..99bacf463 100644
--- a/winsup/mingw/mingwex/wcstoimax.c
+++ b/winsup/mingw/mingwex/wcstoimax.c
@@ -89,7 +89,7 @@ wcstoimax(nptr, endptr, base)
accum = n;
for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr )
- if ( accum > INTMAX_MAX / base + 2 ) /* major wrap-around */
+ if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */
toobig = 1; /* but keep scanning */
else
accum = base * accum + n;
diff --git a/winsup/mingw/mingwex/wtoll.c b/winsup/mingw/mingwex/wtoll.c
index 48f856245..0bff278d1 100644
--- a/winsup/mingw/mingwex/wtoll.c
+++ b/winsup/mingw/mingwex/wtoll.c
@@ -1,3 +1,3 @@
#include <stdlib.h>
long long wtoll(const wchar_t * _w)
- { return _wtoi64 (_w); };
+ { return _wtoi64 (_w); }
diff --git a/winsup/mingw/moldname-crtdll.def b/winsup/mingw/moldname-crtdll.def
deleted file mode 100644
index fd44c768a..000000000
--- a/winsup/mingw/moldname-crtdll.def
+++ /dev/null
@@ -1,151 +0,0 @@
-;
-; moldname-crtdll.def
-;
-; Exports from the runtime except that these exports are actually preceeded
-; by a underscore in the actual DLL. These correspond to functions which
-; are non-ANSI and were prefixed with an underscore to avoid name space
-; clutter. However many, in fact most programs still use a few of these
-; functions without the underscore. This .def file is specially processed
-; to make those non-underscored name function calls call the equivalent
-; underscored functions.
-;
-; Contributors:
-; Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
-; Maintained by Mumit Khan <khan@xraylith.wisc.edu>
-;
-; THIS SOFTWARE IS NOT COPYRIGHTED
-;
-; This source code is offered for use in the public domain. You may
-; use, modify or distribute it freely.
-;
-; This code is distributed in the hope that it will be useful but
-; WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
-; DISCLAMED. This includes but is not limited to warrenties of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-;
-EXPORTS
-access
-beep
-chdir
-chmod
-chsize
-close
-creat
-cwait
-
-
-
-dup
-dup2
-ecvt
-eof
-execl
-execle
-execlp
-execlpe
-execv
-execve
-execvp
-execvpe
-fcvt
-fdopen
-fgetchar
-fgetwchar
-filelength
-fileno
-; Alias fpreset is set in CRT_fp10,c and CRT_fp8.c.
-; fpreset
-fputchar
-fputwchar
-fstat
-ftime
-gcvt
-getch
-getche
-getcwd
-getpid
-getw
-heapwalk
-isatty
-itoa
-kbhit
-lseek
-ltoa
-memccpy
-memicmp
-mkdir
-mktemp
-open
-pclose
-popen
-putch
-putenv
-putw
-read
-rmdir
-searchenv
-seterrormode
-setmode
-sleep
-sopen
-spawnl
-spawnle
-spawnlp
-spawnlpe
-spawnv
-spawnve
-spawnvp
-spawnvpe
-stat
-strcmpi
-strdup
-stricmp
-stricoll
-strlwr
-strnicmp
-strnset
-strrev
-strset
-strupr
-swab
-tell
-tempnam
-
-
-
-; export tzname for both. See <time.h>
-tzname DATA
-tzset
-umask
-ungetch
-unlink
-utime
-wcsdup
-wcsicmp
-wcsicoll
-wcslwr
-wcsnicmp
-wcsnset
-wcsrev
-wcsset
-wcsupr
-
-
-
-write
-; non-ANSI functions declared in math.h
-j0
-j1
-jn
-y0
-y1
-yn
-chgsign
-scalb
-finite
-fpclass
-; C99 functions
-cabs
-hypot
-logb
-nextafter
diff --git a/winsup/mingw/moldname-msvcrt.def b/winsup/mingw/moldname-msvcrt.def
deleted file mode 100644
index dc9f357ec..000000000
--- a/winsup/mingw/moldname-msvcrt.def
+++ /dev/null
@@ -1,151 +0,0 @@
-;
-; moldname-msvcrt.def
-;
-; Exports from the runtime except that these exports are actually preceeded
-; by a underscore in the actual DLL. These correspond to functions which
-; are non-ANSI and were prefixed with an underscore to avoid name space
-; clutter. However many, in fact most programs still use a few of these
-; functions without the underscore. This .def file is specially processed
-; to make those non-underscored name function calls call the equivalent
-; underscored functions.
-;
-; Contributors:
-; Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
-; Maintained by Mumit Khan <khan@xraylith.wisc.edu>
-;
-; THIS SOFTWARE IS NOT COPYRIGHTED
-;
-; This source code is offered for use in the public domain. You may
-; use, modify or distribute it freely.
-;
-; This code is distributed in the hope that it will be useful but
-; WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
-; DISCLAMED. This includes but is not limited to warrenties of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-;
-EXPORTS
-access
-beep
-chdir
-chmod
-chsize
-close
-creat
-cwait
-
-daylight DATA
-
-dup
-dup2
-ecvt
-eof
-execl
-execle
-execlp
-execlpe
-execv
-execve
-execvp
-execvpe
-fcvt
-fdopen
-fgetchar
-fgetwchar
-filelength
-fileno
-; Alias fpreset is set in CRT_fp10,c and CRT_fp8.c.
-; fpreset
-fputchar
-fputwchar
-fstat
-ftime
-gcvt
-getch
-getche
-getcwd
-getpid
-getw
-heapwalk
-isatty
-itoa
-kbhit
-lseek
-ltoa
-memccpy
-memicmp
-mkdir
-mktemp
-open
-pclose
-popen
-putch
-putenv
-putw
-read
-rmdir
-searchenv
-seterrormode
-setmode
-sleep
-sopen
-spawnl
-spawnle
-spawnlp
-spawnlpe
-spawnv
-spawnve
-spawnvp
-spawnvpe
-stat
-strcmpi
-strdup
-stricmp
-stricoll
-strlwr
-strnicmp
-strnset
-strrev
-strset
-strupr
-swab
-tell
-tempnam
-
-timezone DATA
-
-; export tzname for both. See <time.h>
-tzname DATA
-tzset
-umask
-ungetch
-unlink
-utime
-wcsdup
-wcsicmp
-wcsicoll
-wcslwr
-wcsnicmp
-wcsnset
-wcsrev
-wcsset
-wcsupr
-
-wpopen
-
-write
-; non-ANSI functions declared in math.h
-j0
-j1
-jn
-y0
-y1
-yn
-chgsign
-scalb
-finite
-fpclass
-; C99 functions
-cabs
-hypot
-logb
-nextafter
diff --git a/winsup/mingw/moldname.def b/winsup/mingw/moldname.def
deleted file mode 100644
index 369439b5c..000000000
--- a/winsup/mingw/moldname.def
+++ /dev/null
@@ -1,137 +0,0 @@
-;
-; moldname.def
-;
-; Exports from the runtime except that these exports are actually preceeded
-; by a underscore in the actual DLL. These correspond to functions which
-; are non-ANSI and were prefixed with an underscore to avoid name space
-; clutter. However many, in fact most programs still use a few of these
-; functions without the underscore. This .def file is specially processed
-; to make those non-underscored name function calls call the equivalent
-; underscored functions.
-;
-; NOTE: All the names currently included are available from both msvcrt and
-; crtdll. This may change in the future and require a new .def to be
-; created.
-;
-; Contributors:
-; Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
-;
-; THIS SOFTWARE IS NOT COPYRIGHTED
-;
-; This source code is offered for use in the public domain. You may
-; use, modify or distribute it freely.
-;
-; This code is distributed in the hope that it will be useful but
-; WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
-; DISCLAMED. This includes but is not limited to warrenties of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-;
-; $Revision$
-; $Author$
-; $Date$
-;
-EXPORTS
-access
-beep
-cabs
-chdir
-chmod
-chsize
-close
-creat
-cwait
-dup
-dup2
-ecvt
-eof
-execl
-execle
-execlp
-execlpe
-execv
-execve
-execvp
-execvpe
-fcvt
-fdopen
-fgetchar
-fgetwchar
-filelength
-fileno
-fputchar
-fputwchar
-fstat
-ftime
-gcvt
-getch
-getche
-getcwd
-getpid
-getw
-heapwalk
-hypot
-isatty
-itoa
-j0
-j1
-jn
-kbhit
-lseek
-ltoa
-memccpy
-memicmp
-mkdir
-mktemp
-open
-pclose
-popen
-putch
-putenv
-putw
-read
-rmdir
-searchenv
-seterrormode
-setmode
-sleep
-sopen
-spawnl
-spawnle
-spawnlp
-spawnlpe
-spawnv
-spawnve
-spawnvp
-spawnvpe
-stat
-strcmpi
-strdup
-stricmp
-stricoll
-strlwr
-strnicmp
-strnset
-strrev
-strset
-strupr
-swab
-tell
-tempnam
-tzset
-umask
-ungetch
-unlink
-utime
-wcsdup
-wcsicmp
-wcsicoll
-wcslwr
-wcsnicmp
-wcsnset
-wcsrev
-wcsset
-wcsupr
-write
-y0
-y1
-yn
diff --git a/winsup/mingw/msvcrt.def b/winsup/mingw/msvcrt.def
deleted file mode 100644
index 0b85e9e1c..000000000
--- a/winsup/mingw/msvcrt.def
+++ /dev/null
@@ -1,737 +0,0 @@
-;
-; msvcrt.def
-;
-; Exports from msvcrt.dll. Msvcrt.dll appears to be distributed with
-; Internet Explorer 4.0, and may be more common in the future, but
-; right now it seems like a risky choice. There are differences, although
-; they seem to be minor overall, between the exports from msvcrt and msvcrt20.
-; However, for most purposes the two sets are interchangable.
-;
-; NOTE: All exports, except for what appeared to be C++ mangled names,
-; are included. Not all functions have prototypes in the headers
-; (and some aren't functions at all).
-;
-; Contributors:
-; Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
-;
-; THIS SOFTWARE IS NOT COPYRIGHTED
-;
-; This source code is offered for use in the public domain. You may
-; use, modify or distribute it freely.
-;
-; This code is distributed in the hope that it will be useful but
-; WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
-; DISCLAMED. This includes but is not limited to warrenties of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-;
-; $Revision$
-; $Author$
-; $Date$
-;
-EXPORTS
-_CIacos
-_CIasin
-_CIatan
-_CIatan2
-_CIcos
-_CIcosh
-_CIexp
-_CIfmod
-_CIlog
-_CIlog10
-_CIpow
-_CIsin
-_CIsinh
-_CIsqrt
-_CItan
-_CItanh
-_CxxThrowException
-_EH_prolog
-_Getdays
-_Getmonths
-_Gettnames
-_HUGE DATA
-_Strftime
-_XcptFilter
-__CxxFrameHandler
-__CxxLongjmpUnwind
-__RTCastToVoid
-__RTDynamicCast
-__RTtypeid
-__STRINGTOLD
-__argc DATA
-__argv DATA
-__badioinfo
-__crtCompareStringA
-__crtGetLocaleInfoW
-__crtLCMapStringA
-__dllonexit
-__doserrno
-__fpecode
-__getmainargs
-__initenv DATA
-__isascii
-__iscsym
-__iscsymf
-__lc_codepage
-__lc_handle
-__lconv_init
-__mb_cur_max DATA
-__p___argc
-__p___argv
-__p___initenv
-__p___mb_cur_max
-__p___wargv
-__p___winitenv
-__p__acmdln
-__p__amblksiz
-__p__commode
-__p__daylight
-__p__dstbias
-__p__environ
-__p__fileinfo
-__p__fmode
-__p__iob
-__p__mbctype
-__p__osver
-__p__pctype
-__p__pgmptr
-__p__pwctype
-__p__timezone
-__p__tzname
-__p__wcmdln
-__p__wenviron
-__p__winmajor
-__p__winminor
-__p__winver
-__p__wpgmptr
-__pioinfo
-__pxcptinfoptrs
-__set_app_type
-__setlc_active
-__setusermatherr
-__threadhandle
-__threadid
-__toascii
-__unDName
-__unguarded_readlc_active
-__wargv DATA
-__wgetmainargs
-__winitenv DATA
-_abnormal_termination
-_access
-_acmdln DATA
-_adj_fdiv_m16i
-_adj_fdiv_m32
-_adj_fdiv_m32i
-_adj_fdiv_m64
-_adj_fdiv_r
-_adj_fdivr_m16i
-_adj_fdivr_m32
-_adj_fdivr_m32i
-_adj_fdivr_m64
-_adj_fpatan
-_adj_fprem
-_adj_fprem1
-_adj_fptan
-_adjust_fdiv DATA
-_aexit_rtn DATA
-_amsg_exit
-_assert
-_atodbl
-_atoi64
-_atoldbl
-_beep
-_beginthread
-_beginthreadex
-_c_exit
-_cabs
-_callnewh
-_cexit
-_cgets
-_chdir
-_chdrive
-_chgsign
-_chmod
-_chsize
-_clearfp
-_close
-_commit
-_commode DATA
-_control87
-_controlfp
-_copysign
-_cprintf
-_cputs
-_creat
-_cscanf
-_ctype DATA
-_cwait
-_daylight DATA
-_dstbias
-_dup
-_dup2
-_ecvt
-_endthread
-_endthreadex
-_environ DATA
-_eof
-_errno
-_except_handler2
-_except_handler3
-_execl
-_execle
-_execlp
-_execlpe
-_execv
-_execve
-_execvp
-_execvpe
-_exit
-_expand
-_fcloseall
-_fcvt
-_fdopen
-_fgetchar
-_fgetwchar
-_filbuf
-_fileinfo DATA
-_filelength
-_filelengthi64
-_fileno
-_findclose
-_findfirst
-_findfirsti64
-_findnext
-_findnexti64
-_finite
-_flsbuf
-_flushall
-_fmode DATA
-_fpclass
-_fpieee_flt
-_fpreset DATA
-_fputchar
-_fputwchar
-_fsopen
-_fstat
-_fstati64
-_ftime
-_ftol
-_fullpath
-_futime
-_gcvt
-_get_osfhandle
-_get_sbh_threshold
-_getch
-_getche
-_getcwd
-_getdcwd
-_getdiskfree
-_getdllprocaddr
-_getdrive
-_getdrives
-_getmaxstdio
-_getmbcp
-_getpid
-_getsystime
-_getw
-_getws
-_global_unwind2
-_heapadd
-_heapchk
-_heapmin
-_heapset
-_heapused
-_heapwalk
-_hypot
-_i64toa
-_i64tow
-_initterm
-_inp
-_inpd
-_inpw
-_iob DATA
-_isatty
-_isctype
-_ismbbalnum
-_ismbbalpha
-_ismbbgraph
-_ismbbkalnum
-_ismbbkana
-_ismbbkprint
-_ismbbkpunct
-_ismbblead
-_ismbbprint
-_ismbbpunct
-_ismbbtrail
-_ismbcalnum
-_ismbcalpha
-_ismbcdigit
-_ismbcgraph
-_ismbchira
-_ismbckata
-_ismbcl0
-_ismbcl1
-_ismbcl2
-_ismbclegal
-_ismbclower
-_ismbcprint
-_ismbcpunct
-_ismbcspace
-_ismbcsymbol
-_ismbcupper
-_ismbslead
-_ismbstrail
-_isnan
-_itoa
-_itow
-_j0
-_j1
-_jn
-_kbhit
-_lfind
-_loaddll
-_local_unwind2
-_lock
-_locking
-_logb
-_longjmpex
-_lrotl
-_lrotr
-_lsearch
-_lseek
-_lseeki64
-_ltoa
-_ltow
-_makepath
-_mbbtombc
-_mbbtype
-_mbccpy
-_mbcjistojms
-_mbcjmstojis
-_mbclen
-_mbctohira
-_mbctokata
-_mbctolower
-_mbctombb
-_mbctoupper
-_mbctype DATA
-_mbsbtype
-_mbscat
-_mbschr
-_mbscmp
-_mbscoll
-_mbscpy
-_mbscspn
-_mbsdec
-_mbsdup
-_mbsicmp
-_mbsicoll
-_mbsinc
-_mbslen
-_mbslwr
-_mbsnbcat
-_mbsnbcmp
-_mbsnbcnt
-_mbsnbcoll
-_mbsnbcpy
-_mbsnbicmp
-_mbsnbicoll
-_mbsnbset
-_mbsncat
-_mbsnccnt
-_mbsncmp
-_mbsncoll
-_mbsncpy
-_mbsnextc
-_mbsnicmp
-_mbsnicoll
-_mbsninc
-_mbsnset
-_mbspbrk
-_mbsrchr
-_mbsrev
-_mbsset
-_mbsspn
-_mbsspnp
-_mbsstr
-_mbstok
-_mbstrlen
-_mbsupr
-_memccpy
-_memicmp
-_mkdir
-_mktemp
-_msize
-_nextafter
-_onexit DATA
-_open
-_open_osfhandle
-_osver DATA
-_outp
-_outpd
-_outpw
-_pclose
-_pctype DATA
-_pgmptr DATA
-_pipe
-_popen
-_purecall
-_putch
-_putenv
-_putw
-_putws
-_pwctype DATA
-_read
-_rmdir
-_rmtmp
-_rotl
-_rotr
-_safe_fdiv
-_safe_fdivr
-_safe_fprem
-_safe_fprem1
-_scalb
-_searchenv
-_seh_longjmp_unwind
-_set_error_mode
-_set_sbh_threshold
-_seterrormode
-_setjmp
-_setjmp3
-_setmaxstdio
-_setmbcp
-_setmode
-_setsystime
-_sleep
-_snprintf
-_snwprintf
-_sopen
-_spawnl
-_spawnle
-_spawnlp
-_spawnlpe
-_spawnv
-_spawnve
-_spawnvp
-_spawnvpe
-_splitpath
-_stat
-_stati64
-_statusfp
-_strcmpi
-_strdate
-_strdup
-_strerror
-_stricmp
-_stricoll
-_strlwr
-_strncoll
-_strnicmp
-_strnicoll
-_strnset
-_strrev
-_strset
-_strtime
-_strupr
-_swab
-_sys_errlist DATA
-_sys_nerr DATA
-_tell
-_telli64
-_tempnam
-_timezone DATA
-_tolower
-_toupper
-_tzname DATA
-_tzset
-_ui64toa
-_ui64tow
-_ultoa
-_ultow
-_umask
-_ungetch
-_unlink
-_unloaddll
-_unlock
-_utime
-_vsnprintf
-_vsnwprintf
-_waccess
-_wasctime
-_wchdir
-_wchmod
-_wcmdln DATA
-_wcreat
-_wcsdup
-_wcsicmp
-_wcsicoll
-_wcslwr
-_wcsncoll
-_wcsnicmp
-_wcsnicoll
-_wcsnset
-_wcsrev
-_wcsset
-_wcsupr
-_wctime
-_wenviron DATA
-_wexecl
-_wexecle
-_wexeclp
-_wexeclpe
-_wexecv
-_wexecve
-_wexecvp
-_wexecvpe
-_wfdopen
-_wfindfirst
-_wfindfirsti64
-_wfindnext
-_wfindnexti64
-_wfopen
-_wfreopen
-_wfsopen
-_wfullpath
-_wgetcwd
-_wgetdcwd
-_wgetenv
-_winmajor DATA
-_winminor DATA
-_winver DATA
-_wmakepath
-_wmkdir
-_wmktemp
-_wopen
-_wperror
-_wpgmptr DATA
-_wpopen
-_wputenv
-_wremove
-_wrename
-_write
-_wrmdir
-_wsearchenv
-_wsetlocale
-_wsopen
-_wspawnl
-_wspawnle
-_wspawnlp
-_wspawnlpe
-_wspawnv
-_wspawnve
-_wspawnvp
-_wspawnvpe
-_wsplitpath
-_wstat
-_wstati64
-_wstrdate
-_wstrtime
-_wsystem
-_wtempnam
-_wtmpnam
-_wtoi
-_wtoi64
-_wtol
-_wunlink
-_wutime
-_y0
-_y1
-_yn
-abort
-abs
-acos
-asctime
-asin
-atan
-atan2
-atexit DATA
-atof
-atoi
-atol
-bsearch
-calloc
-ceil
-clearerr
-clock
-cos
-cosh
-ctime
-difftime
-div
-exit
-exp
-fabs
-fclose
-feof
-ferror
-fflush
-fgetc
-fgetpos
-fgets
-fgetwc
-fgetws
-floor
-fmod
-fopen
-fprintf
-fputc
-fputs
-fputwc
-fputws
-fread
-free
-freopen
-frexp
-fscanf
-fseek
-fsetpos
-ftell
-fwprintf
-fwrite
-fwscanf
-getc
-getchar
-getenv
-gets
-getwc
-getwchar
-gmtime
-is_wctype
-isalnum
-isalpha
-iscntrl
-isdigit
-isgraph
-isleadbyte
-islower
-isprint
-ispunct
-isspace
-isupper
-iswalnum
-iswalpha
-iswascii
-iswcntrl
-iswctype
-iswdigit
-iswgraph
-iswlower
-iswprint
-iswpunct
-iswspace
-iswupper
-iswxdigit
-isxdigit
-labs
-ldexp
-ldiv
-localeconv
-localtime
-log
-log10
-longjmp
-malloc
-mblen
-mbstowcs
-mbtowc
-memchr
-memcmp
-memcpy
-memmove
-memset
-mktime
-modf
-perror
-pow
-printf
-putc
-putchar
-puts
-putwc
-putwchar
-qsort
-raise
-rand
-realloc
-remove
-rename
-rewind
-scanf
-setbuf
-setlocale
-setvbuf
-signal
-sin
-sinh
-sprintf
-sqrt
-srand
-sscanf
-strcat
-strchr
-strcmp
-strcoll
-strcpy
-strcspn
-strerror
-strftime
-strlen
-strncat
-strncmp
-strncpy
-strpbrk
-strrchr
-strspn
-strstr
-strtod
-strtok
-strtol
-strtoul
-strxfrm
-swprintf
-swscanf
-system
-tan
-tanh
-time
-tmpfile
-tmpnam
-tolower
-toupper
-towlower
-towupper
-ungetc
-ungetwc
-vfprintf
-vfwprintf
-vprintf
-vsprintf
-vswprintf
-vwprintf
-wcscat
-wcschr
-wcscmp
-wcscoll
-wcscpy
-wcscspn
-wcsftime
-wcslen
-wcsncat
-wcsncmp
-wcsncpy
-wcspbrk
-wcsrchr
-wcsspn
-wcsstr
-wcstod
-wcstok
-wcstol
-wcstombs
-wcstoul
-wcsxfrm
-wctomb
-wprintf
-wscanf
-
diff --git a/winsup/mingw/msvcrt20.def b/winsup/mingw/msvcrt20.def
deleted file mode 100644
index 9ceb0750e..000000000
--- a/winsup/mingw/msvcrt20.def
+++ /dev/null
@@ -1,719 +0,0 @@
-;
-; msvcrt20.def
-;
-; Exports from msvcrt20.dll. I am hoping that msvcrt20.dll will be reasonably
-; common on user systems (if not ubiquitous) so that, effectively, it can
-; be considered part of the OS. Apparently it was included with the Windows 95
-; distribution, so it should be present there at least.
-;
-; NOTE: All exports, except for what appeared to be C++ mangled names,
-; are included. Not all functions have prototypes in the headers
-; (and some aren't functions at all).
-;
-; Contributors:
-; Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
-;
-; THIS SOFTWARE IS NOT COPYRIGHTED
-;
-; This source code is offered for use in the public domain. You may
-; use, modify or distribute it freely.
-;
-; This code is distributed in the hope that it will be useful but
-; WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
-; DISCLAMED. This includes but is not limited to warrenties of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-;
-; $Revision$
-; $Author$
-; $Date$
-;
-EXPORTS
-_CIacos
-_CIasin
-_CIatan
-_CIatan2
-_CIcos
-_CIcosh
-_CIexp
-_CIfmod
-_CIlog
-_CIlog10
-_CIpow
-_CIsin
-_CIsinh
-_CIsqrt
-_CItan
-_CItanh
-_CxxThrowException
-_HUGE
-_XcptFilter
-__CxxFrameHandler
-__CxxLongjmpUnwind
-__STRINGTOLD
-__argc
-__argv
-__dllonexit
-__doserrno
-__fpecode
-__getmainargs
-__initenv
-__isascii
-__iscsym
-__iscsymf
-__lconv_init
-__mb_cur_max
-__p___argc
-__p___argv
-__p___initenv
-__p___mb_cur_max
-__p___wargv
-__p___winitenv
-__p__acmdln
-__p__amblksiz
-__p__commode
-__p__daylight
-__p__environ
-__p__fmode
-__p__iob
-__p__mbctype
-__p__osver
-__p__pctype
-__p__pgmptr
-__p__pwctype
-__p__timezone
-__p__tzname
-__p__wcmdln
-__p__wenviron
-__p__winmajor
-__p__winminor
-__p__winver
-__p__wpgmptr
-__pxcptinfoptrs
-__threadhandle
-__threadid
-__toascii
-__wargv
-__wgetmainargs
-__winitenv
-_abnormal_termination
-_access
-_acmdln
-_adj_fdiv_m16i
-_adj_fdiv_m32
-_adj_fdiv_m32i
-_adj_fdiv_m64
-_adj_fdiv_r
-_adj_fdivr_m16i
-_adj_fdivr_m32
-_adj_fdivr_m32i
-_adj_fdivr_m64
-_adj_fpatan
-_adj_fprem
-_adj_fprem1
-_adj_fptan
-_adjust_fdiv
-_aexit_rtn
-_amsg_exit
-_assert
-_atodbl
-_atoldbl
-_beep
-_beginthread
-_beginthreadex
-_c_exit
-_cabs
-_cexit
-_cgets
-_chdir
-_chdrive
-_chgsign
-_chmod
-_chsize
-_clearfp
-_close
-_commit
-_commode
-_control87
-_controlfp
-_copysign
-_cprintf
-_cputs
-_creat
-_cscanf
-_ctype
-_cwait
-_daylight
-_dup
-_dup2
-_ecvt
-_endthread
-_endthreadex
-_environ
-_eof
-_errno
-_except_handler2
-_except_handler3
-_execl
-_execle
-_execlp
-_execlpe
-_execv
-_execve
-_execvp
-_execvpe
-_exit
-_expand
-_fcloseall
-_fcvt
-_fdopen
-_fgetchar
-_fgetwchar
-_filbuf
-_fileinfo
-_filelength
-_fileno
-_findclose
-_findfirst
-_findnext
-_finite
-_flsbuf
-_flushall
-_fmode
-_fpclass
-_fpieee_flt
-_fpreset DATA
-_fputchar
-_fputwchar
-_fsopen
-_fstat
-_ftime
-_ftol
-_fullpath
-_futime
-_gcvt
-_get_osfhandle
-_getch
-_getche
-_getcwd
-_getdcwd
-_getdiskfree
-_getdllprocaddr
-_getdrive
-_getdrives
-_getmbcp
-_getpid
-_getsystime
-_getw
-_getws
-_global_unwind2
-_heapadd
-_heapchk
-_heapmin
-_heapset
-_heapused
-_heapwalk
-_hypot
-_initterm
-_iob
-_isatty
-_isctype
-_ismbbalnum
-_ismbbalpha
-_ismbbgraph
-_ismbbkalnum
-_ismbbkana
-_ismbbkprint
-_ismbbkpunct
-_ismbblead
-_ismbbprint
-_ismbbpunct
-_ismbbtrail
-_ismbcalnum
-_ismbcalpha
-_ismbcdigit
-_ismbcgraph
-_ismbchira
-_ismbckata
-_ismbcl0
-_ismbcl1
-_ismbcl2
-_ismbclegal
-_ismbclower
-_ismbcprint
-_ismbcpunct
-_ismbcspace
-_ismbcsymbol
-_ismbcupper
-_ismbslead
-_ismbstrail
-_isnan
-_itoa
-_itow
-_j0
-_j1
-_jn
-_kbhit
-_lfind
-_loaddll
-_local_unwind2
-_locking
-_logb
-_longjmpex
-_lrotl
-_lrotr
-_lsearch
-_lseek
-_ltoa
-_ltow
-_makepath
-_matherr
-_mbbtombc
-_mbbtype
-_mbccpy
-_mbcjistojms
-_mbcjmstojis
-_mbclen
-_mbctohira
-_mbctokata
-_mbctolower
-_mbctombb
-_mbctoupper
-_mbctype
-_mbsbtype
-_mbscat
-_mbschr
-_mbscmp
-_mbscoll
-_mbscpy
-_mbscspn
-_mbsdec
-_mbsdup
-_mbsicmp
-_mbsicoll
-_mbsinc
-_mbslen
-_mbslwr
-_mbsnbcat
-_mbsnbcmp
-_mbsnbcnt
-_mbsnbcoll
-_mbsnbcpy
-_mbsnbicmp
-_mbsnbicoll
-_mbsnbset
-_mbsncat
-_mbsnccnt
-_mbsncmp
-_mbsncoll
-_mbsncpy
-_mbsnextc
-_mbsnicmp
-_mbsnicoll
-_mbsninc
-_mbsnset
-_mbspbrk
-_mbsrchr
-_mbsrev
-_mbsset
-_mbsspn
-_mbsspnp
-_mbsstr
-_mbstok
-_mbstrlen
-_mbsupr
-_memccpy
-_memicmp
-_mkdir
-_mktemp
-_msize
-_mtlock
-_mtunlock
-_nextafter
-_onexit DATA
-_open
-_open_osfhandle
-_osver
-_pclose
-_pctype
-_pgmptr
-_pipe
-_popen
-_purecall
-_putch
-_putenv
-_putw
-_putws
-_pwctype
-_read
-_rmdir
-_rmtmp
-_rotl
-_rotr
-_safe_fdiv
-_safe_fdivr
-_safe_fprem
-_safe_fprem1
-_scalb
-_searchenv
-__seh_longjmp_unwind@4
-_seterrormode
-_setjmp
-_setjmp3
-_setmbcp
-_setmode
-_setsystime
-_sleep
-_snprintf
-_snwprintf
-_sopen
-_spawnl
-_spawnle
-_spawnlp
-_spawnlpe
-_spawnv
-_spawnve
-_spawnvp
-_spawnvpe
-_splitpath
-_stat
-_statusfp
-_strcmpi
-_strdate
-_strdup
-_strerror
-_stricmp
-_stricoll
-_strlwr
-_strncoll
-_strnicmp
-_strnicoll
-_strnset
-_strrev
-_strset
-_strtime
-_strupr
-_swab
-_sys_errlist
-_sys_nerr
-_tccpy
-_tclen
-_tcschr
-_tcsclen
-_tcscmp
-_tcscspn
-_tcsdec
-_tcsicmp
-_tcsinc
-_tcslwr
-_tcsnbcnt
-_tcsncat
-_tcsnccat
-_tcsnccmp
-_tcsnccnt
-_tcsnccpy
-_tcsncicmp
-_tcsncmp
-_tcsncpy
-_tcsncset
-_tcsnextc
-_tcsnicmp
-_tcsninc
-_tcsnset
-_tcspbrk
-_tcsrchr
-_tcsrev
-_tcsset
-_tcsspn
-_tcsspnp
-_tcsstr
-_tcstok
-_tcsupr
-_tell
-_tempnam
-_timezone
-_tolower
-_toupper
-_tzname
-_tzset
-_ultoa
-_ultow
-_umask
-_ungetch
-_unlink
-_unloaddll
-_utime
-_vsnprintf
-_vsnwprintf
-_waccess
-_wasctime
-_wchdir
-_wchmod
-_wcmdln
-_wcreat
-_wcsdup
-_wcsicmp
-_wcsicoll
-_wcslwr
-_wcsncoll
-_wcsnicmp
-_wcsnicoll
-_wcsnset
-_wcsrev
-_wcsset
-_wcsupr
-_wctime
-_wenviron
-_wexecl
-_wexecle
-_wexeclp
-_wexeclpe
-_wexecv
-_wexecve
-_wexecvp
-_wexecvpe
-_wfdopen
-_wfindfirst
-_wfindnext
-_wfopen
-_wfreopen
-_wfsopen
-_wfullpath
-_wgetcwd
-_wgetdcwd
-_wgetenv
-_winmajor
-_winminor
-_winver
-_wmakepath
-_wmkdir
-_wmktemp
-_wopen
-_wperror
-_wpgmptr
-_wpopen
-_wputenv
-_wremove
-_wrename
-_write
-_wrmdir
-_wsearchenv
-_wsetlocale
-_wsopen
-_wspawnl
-_wspawnle
-_wspawnlp
-_wspawnlpe
-_wspawnv
-_wspawnve
-_wspawnvp
-_wspawnvpe
-_wsplitpath
-_wstat
-_wstrdate
-_wstrtime
-_wsystem
-_wtempnam
-_wtmpnam
-_wtoi
-_wtol
-_wunlink
-_wutime
-_y0
-_y1
-_yn
-abort
-abs
-acos
-asctime
-asin
-atan
-atan2
-atexit DATA
-atof
-atoi
-atol
-bsearch
-calloc
-ceil
-clearerr
-clock
-cos
-cosh
-ctime
-difftime
-div
-exit
-exp
-fabs
-fclose
-feof
-ferror
-fflush
-fgetc
-fgetpos
-fgets
-fgetwc
-fgetws
-floor
-fmod
-fopen
-fprintf
-fputc
-fputs
-fputwc
-fputws
-fread
-free
-freopen
-frexp
-fscanf
-fseek
-fsetpos
-ftell
-fwprintf
-fwrite
-fwscanf
-getc
-getchar
-getenv
-gets
-getwc
-getwchar
-gmtime
-is_wctype
-isalnum
-isalpha
-iscntrl
-isdigit
-isgraph
-isleadbyte
-islower
-isprint
-ispunct
-isspace
-isupper
-iswalnum
-iswalpha
-iswascii
-iswcntrl
-iswctype
-iswdigit
-iswgraph
-iswlower
-iswprint
-iswpunct
-iswspace
-iswupper
-iswxdigit
-isxdigit
-labs
-ldexp
-ldiv
-localeconv
-localtime
-log
-log10
-longjmp
-malloc
-mblen
-mbstowcs
-mbtowc
-memchr
-memcmp
-memcpy
-memmove
-memset
-mktime
-modf
-perror
-pow
-printf
-putc
-putchar
-puts
-putwc
-putwchar
-qsort
-raise
-rand
-realloc
-remove
-rename
-rewind
-scanf
-setbuf
-setlocale
-setvbuf
-signal
-sin
-sinh
-sprintf
-sqrt
-srand
-sscanf
-strcat
-strchr
-strcmp
-strcoll
-strcpy
-strcspn
-strerror
-strftime
-strlen
-strncat
-strncmp
-strncpy
-strpbrk
-strrchr
-strspn
-strstr
-strtod
-strtok
-strtol
-strtoul
-strxfrm
-swprintf
-swscanf
-system
-tan
-tanh
-time
-tmpfile
-tmpnam
-tolower
-toupper
-towlower
-towupper
-ungetc
-ungetwc
-vfprintf
-vfwprintf
-vprintf
-vsprintf
-vswprintf
-vwprintf
-wcscat
-wcschr
-wcscmp
-wcscoll
-wcscpy
-wcscspn
-wcsftime
-wcslen
-wcsncat
-wcsncmp
-wcsncpy
-wcspbrk
-wcsrchr
-wcsspn
-wcsstr
-wcstod
-wcstok
-wcstol
-wcstombs
-wcstoul
-wcsxfrm
-wctomb
-wprintf
-wscanf
-
diff --git a/winsup/mingw/msvcrt40.def b/winsup/mingw/msvcrt40.def
deleted file mode 100644
index e4b09f999..000000000
--- a/winsup/mingw/msvcrt40.def
+++ /dev/null
@@ -1,676 +0,0 @@
-EXPORTS
-$I10_OUTPUT
-_CIacos
-_CIasin
-_CIatan
-_CIatan2
-_CIcos
-_CIcosh
-_CIexp
-_CIfmod
-_CIlog
-_CIlog10
-_CIpow
-_CIsin
-_CIsinh
-_CIsqrt
-_CItan
-_CItanh
-_CxxThrowException
-_EH_prolog
-_HUGE
-_XcptFilter
-__CxxFrameHandler
-__CxxLongjmpUnwind
-__RTCastToVoid
-__RTDynamicCast
-__RTtypeid
-__STRINGTOLD
-__argc
-__argv
-__dllonexit
-__doserrno
-__fpecode
-__getmainargs
-__initenv
-__isascii
-__iscsym
-__iscsymf
-__lconv_init
-__mb_cur_max
-__p___argc
-__p___argv
-__p___initenv
-__p___mb_cur_max
-__p___wargv
-__p___winitenv
-__p__acmdln
-__p__amblksiz
-__p__commode
-__p__daylight
-__p__environ
-__p__fmode
-__p__iob
-__p__mbctype
-__p__osver
-__p__pctype
-__p__pgmptr
-__p__pwctype
-__p__timezone
-__p__tzname
-__p__wcmdln
-__p__wenviron
-__p__winmajor
-__p__winminor
-__p__winver
-__p__wpgmptr
-__pxcptinfoptrs
-__set_app_type
-__setusermatherr
-__threadhandle
-__threadid
-__toascii
-__unDName
-__wargv
-__wgetmainargs
-__winitenv
-_abnormal_termination
-_access
-_acmdln
-_adj_fdiv_m16i
-_adj_fdiv_m32
-_adj_fdiv_m32i
-_adj_fdiv_m64
-_adj_fdiv_r
-_adj_fdivr_m16i
-_adj_fdivr_m32
-_adj_fdivr_m32i
-_adj_fdivr_m64
-_adj_fpatan
-_adj_fprem
-_adj_fprem1
-_adj_fptan
-_adjust_fdiv
-_aexit_rtn
-_amsg_exit
-_assert
-_atodbl
-_atoldbl
-_beep
-_beginthread
-_beginthreadex
-_c_exit
-_cabs
-_cexit
-_cgets
-_chdir
-_chdrive
-_chgsign
-_chmod
-_chsize
-_clearfp
-_close
-_commit
-_commode
-_control87
-_controlfp
-_copysign
-_cprintf
-_cputs
-_creat
-_cscanf
-_ctype
-_cwait
-_daylight
-_dup
-_dup2
-_ecvt
-_endthread
-_endthreadex
-_environ
-_eof
-_errno
-_except_handler2
-_except_handler3
-_execl
-_execle
-_execlp
-_execlpe
-_execv
-_execve
-_execvp
-_execvpe
-_exit
-_expand
-_fcloseall
-_fcvt
-_fdopen
-_fgetchar
-_fgetwchar
-_filbuf
-_fileinfo
-_filelength
-_filelengthi64
-_fileno
-_findclose
-_findfirst
-_findfirsti64
-_findnext
-_findnexti64
-_finite
-_flsbuf
-_flushall
-_fmode
-_fpclass
-_fpieee_flt
-_fpreset DATA
-_fputchar
-_fputwchar
-_fsopen
-_fstat
-_fstati64
-_ftime
-_ftol
-_fullpath
-_futime
-_gcvt
-_get_osfhandle
-_getch
-_getche
-_getcwd
-_getdcwd
-_getdiskfree
-_getdllprocaddr
-_getdrive
-_getdrives
-_getmbcp
-_getpid
-_getsystime
-_getw
-_getws
-_global_unwind2
-_heapadd
-_heapchk
-_heapmin
-_heapset
-_heapused
-_heapwalk
-_hypot
-_initterm
-_iob
-_isatty
-_isctype
-_ismbbalnum
-_ismbbalpha
-_ismbbgraph
-_ismbbkalnum
-_ismbbkana
-_ismbbkprint
-_ismbbkpunct
-_ismbblead
-_ismbbprint
-_ismbbpunct
-_ismbbtrail
-_ismbcalnum
-_ismbcalpha
-_ismbcdigit
-_ismbcgraph
-_ismbchira
-_ismbckata
-_ismbcl0
-_ismbcl1
-_ismbcl2
-_ismbclegal
-_ismbclower
-_ismbcprint
-_ismbcpunct
-_ismbcspace
-_ismbcsymbol
-_ismbcupper
-_ismbslead
-_ismbstrail
-_isnan
-_itoa
-_itow
-_j0
-_j1
-_jn
-_kbhit
-_lfind
-_loaddll
-_local_unwind2
-_locking
-_logb
-_longjmpex
-_lrotl
-_lrotr
-_lsearch
-_lseek
-_lseeki64
-_ltoa
-_ltow
-_makepath
-_mbbtombc
-_mbbtype
-_mbccpy
-_mbcjistojms
-_mbcjmstojis
-_mbclen
-_mbctohira
-_mbctokata
-_mbctolower
-_mbctombb
-_mbctoupper
-_mbctype
-_mbsbtype
-_mbscat
-_mbschr
-_mbscmp
-_mbscoll
-_mbscpy
-_mbscspn
-_mbsdec
-_mbsdup
-_mbsicmp
-_mbsicoll
-_mbsinc
-_mbslen
-_mbslwr
-_mbsnbcat
-_mbsnbcmp
-_mbsnbcnt
-_mbsnbcoll
-_mbsnbcpy
-_mbsnbicmp
-_mbsnbicoll
-_mbsnbset
-_mbsncat
-_mbsnccnt
-_mbsncmp
-_mbsncoll
-_mbsncpy
-_mbsnextc
-_mbsnicmp
-_mbsnicoll
-_mbsninc
-_mbsnset
-_mbspbrk
-_mbsrchr
-_mbsrev
-_mbsset
-_mbsspn
-_mbsspnp
-_mbsstr
-_mbstok
-_mbstrlen
-_mbsupr
-_memccpy
-_memicmp
-_mkdir
-_mktemp
-_msize
-_mtlock
-_mtunlock
-_nextafter
-_onexit DATA
-_open
-_open_osfhandle
-_osver
-_pclose
-_pctype
-_pgmptr
-_pipe
-_popen
-_purecall
-_putch
-_putenv
-_putw
-_putws
-_pwctype
-_read
-_rmdir
-_rmtmp
-_rotl
-_rotr
-_safe_fdiv
-_safe_fdivr
-_safe_fprem
-_safe_fprem1
-_scalb
-_searchenv
-_seh_longjmp_unwind
-_set_error_mode
-_seterrormode
-_setjmp
-_setjmp3
-_setmaxstdio
-_setmbcp
-_setmode
-_setsystime
-_sleep
-_snprintf
-_snwprintf
-_sopen
-_spawnl
-_spawnle
-_spawnlp
-_spawnlpe
-_spawnv
-_spawnve
-_spawnvp
-_spawnvpe
-_splitpath
-_stat
-_stati64
-_statusfp
-_strcmpi
-_strdate
-_strdup
-_strerror
-_stricmp
-_stricoll
-_strlwr
-_strncoll
-_strnicmp
-_strnicoll
-_strnset
-_strrev
-_strset
-_strtime
-_strupr
-_swab
-_sys_errlist
-_sys_nerr
-_tell
-_telli64
-_tempnam
-_timezone
-_tolower
-_toupper
-_tzname
-_tzset
-_ultoa
-_ultow
-_umask
-_ungetch
-_unlink
-_unloaddll
-_utime
-_vsnprintf
-_vsnwprintf
-_waccess
-_wasctime
-_wchdir
-_wchmod
-_wcmdln
-_wcreat
-_wcsdup
-_wcsicmp
-_wcsicoll
-_wcslwr
-_wcsncoll
-_wcsnicmp
-_wcsnicoll
-_wcsnset
-_wcsrev
-_wcsset
-_wcsupr
-_wctime
-_wenviron
-_wexecl
-_wexecle
-_wexeclp
-_wexeclpe
-_wexecv
-_wexecve
-_wexecvp
-_wexecvpe
-_wfdopen
-_wfindfirst
-_wfindfirsti64
-_wfindnext
-_wfindnexti64
-_wfopen
-_wfreopen
-_wfsopen
-_wfullpath
-_wgetcwd
-_wgetdcwd
-_wgetenv
-_winmajor
-_winminor
-_winver
-_wmakepath
-_wmkdir
-_wmktemp
-_wopen
-_wperror
-_wpgmptr
-_wpopen
-_wputenv
-_wremove
-_wrename
-_write
-_wrmdir
-_wsearchenv
-_wsetlocale
-_wsopen
-_wspawnl
-_wspawnle
-_wspawnlp
-_wspawnlpe
-_wspawnv
-_wspawnve
-_wspawnvp
-_wspawnvpe
-_wsplitpath
-_wstat
-_wstati64
-_wstrdate
-_wstrtime
-_wsystem
-_wtempnam
-_wtmpnam
-_wtoi
-_wtol
-_wunlink
-_wutime
-_y0
-_y1
-_yn
-abort
-abs
-acos
-asctime
-asin
-atan
-atan2
-atexit DATA
-atof
-atoi
-atol
-bsearch
-calloc
-ceil
-clearerr
-clock
-cos
-cosh
-ctime
-difftime
-div
-exit
-exp
-fabs
-fclose
-feof
-ferror
-fflush
-fgetc
-fgetpos
-fgets
-fgetwc
-fgetws
-floor
-fmod
-fopen
-fprintf
-fputc
-fputs
-fputwc
-fputws
-fread
-free
-freopen
-frexp
-fscanf
-fseek
-fsetpos
-ftell
-fwprintf
-fwrite
-fwscanf
-getc
-getchar
-getenv
-gets
-getwc
-getwchar
-gmtime
-is_wctype
-isalnum
-isalpha
-iscntrl
-isdigit
-isgraph
-isleadbyte
-islower
-isprint
-ispunct
-isspace
-isupper
-iswalnum
-iswalpha
-iswascii
-iswcntrl
-iswctype
-iswdigit
-iswgraph
-iswlower
-iswprint
-iswpunct
-iswspace
-iswupper
-iswxdigit
-isxdigit
-labs
-ldexp
-ldiv
-localeconv
-localtime
-log
-log10
-longjmp
-malloc
-mblen
-mbstowcs
-mbtowc
-memchr
-memcmp
-memcpy
-memmove
-memset
-mktime
-modf
-perror
-pow
-printf
-putc
-putchar
-puts
-putwc
-putwchar
-qsort
-raise
-rand
-realloc
-remove
-rename
-rewind
-scanf
-setbuf
-setlocale
-setvbuf
-signal
-sin
-sinh
-sprintf
-sqrt
-srand
-sscanf
-strcat
-strchr
-strcmp
-strcoll
-strcpy
-strcspn
-strerror
-strftime
-strlen
-strncat
-strncmp
-strncpy
-strpbrk
-strrchr
-strspn
-strstr
-strtod
-strtok
-strtol
-strtoul
-strxfrm
-swprintf
-swscanf
-system
-tan
-tanh
-time
-tmpfile
-tmpnam
-tolower
-toupper
-towlower
-towupper
-ungetc
-ungetwc
-vfprintf
-vfwprintf
-vprintf
-vsprintf
-vswprintf
-vwprintf
-wcscat
-wcschr
-wcscmp
-wcscoll
-wcscpy
-wcscspn
-wcsftime
-wcslen
-wcsncat
-wcsncmp
-wcsncpy
-wcspbrk
-wcsrchr
-wcsspn
-wcsstr
-wcstod
-wcstok
-wcstol
-wcstombs
-wcstoul
-wcsxfrm
-wctomb
-wprintf
-wscanf
-
diff --git a/winsup/mingw/profile/Makefile.in b/winsup/mingw/profile/Makefile.in
index c7f3a0c7f..aca3a2950 100644
--- a/winsup/mingw/profile/Makefile.in
+++ b/winsup/mingw/profile/Makefile.in
@@ -89,6 +89,13 @@ gcrt1.o: gcrt0.c
gcrt2.o: gcrt0.c
$(CC) -D__MSVCRT__ -c -o $@ $(CPPFLAGS) $(CFLAGS) $?
+#
+# Dependancies
+#
+gmon.o: gmon.c gmon.h profile.h profil.h
+mcount.o: mcount.c gmon.h profile.h
+profil.o: profil.c profil.h
+
Makefile: Makefile.in config.status configure
$(SHELL) config.status
@@ -132,3 +139,4 @@ dist:
@for i in $(DISTFILES); do\
cp -p $(srcdir)/$$i $(distdir)/profile/$$i ; \
done
+
diff --git a/winsup/mingw/profile/profile.h b/winsup/mingw/profile/profile.h
index d578657f8..6c198d742 100644
--- a/winsup/mingw/profile/profile.h
+++ b/winsup/mingw/profile/profile.h
@@ -46,18 +46,20 @@
void \
mcount() \
{ \
- int selfpc, frompcindex; \
+ u_long selfpc, frompcindex; \
/* \
* find the return address for mcount, \
* and the return address for mcount's caller. \
* \
* selfpc = pc pushed by mcount call \
*/ \
- __asm("movl 4(%%ebp),%0" : "=r" (selfpc)); \
+ /* __asm volatile ("movl 4(%%ebp),%0" : "=r" (selfpc)); */ \
+ selfpc = (u_long) __builtin_return_address (0); \
/* \
* frompcindex = pc pushed by call into self. \
*/ \
- __asm("movl (%%ebp),%0;movl 4(%0),%0" : "=r" (frompcindex)); \
+ /* __asm ("movl (%%ebp),%0;movl 4(%0),%0" : "=r" (frompcindex)); */ \
+ frompcindex = (u_long) __builtin_return_address (1); \
_mcount(frompcindex, selfpc); \
}
diff --git a/winsup/mingw/samples/dlltest/dll.def b/winsup/mingw/samples/dlltest/dll.def
index b20a405d8..8dd07fa65 100644
--- a/winsup/mingw/samples/dlltest/dll.def
+++ b/winsup/mingw/samples/dlltest/dll.def
@@ -1,3 +1,4 @@
+LIBRARY dll
EXPORTS
Add
Sub@16
diff --git a/winsup/mingw/samples/dlltest/expexe.def b/winsup/mingw/samples/dlltest/expexe.def
index 309f1508f..d069ce5d0 100644
--- a/winsup/mingw/samples/dlltest/expexe.def
+++ b/winsup/mingw/samples/dlltest/expexe.def
@@ -1,2 +1,3 @@
+NAME exe.exe
EXPORTS
ExportedFromExe
diff --git a/winsup/mingw/test_headers.c b/winsup/mingw/test_headers.c
index e34b152d6..d11865736 100644
--- a/winsup/mingw/test_headers.c
+++ b/winsup/mingw/test_headers.c
@@ -36,7 +36,6 @@
#include <time.h>
#include <unistd.h>
#include <values.h>
-#include <wchar.h>
#include <wctype.h>
#include <sys/fcntl.h>
#include <sys/file.h>
@@ -48,6 +47,7 @@
#include <sys/types.h>
#include <sys/unistd.h>
#include <sys/utime.h>
+#include <wchar.h>
int main()
{return 0;}