* Makefile.in: Remove -[DU]__MSVCRT__ and -[DU]__CRTDLL__.
* crt1.o: Remove CRTDLL specific target.
* dllcrt1.o: Ditto.
* gcrt1.o: Ditto.
* include/assert.h: Modify documentation to remove the use of CRTDLL.
* include/setjmp.h: Ditto.
* src/libcrt/crt/ofmt_stub.s: Ditto.
* include/ctype.h: Ditto.
Remove filters for __MSVCRT__ and unneeded #else coding.
* include/dirent.h: Ditto.
* include/dos.h: Ditto.
* include/io.h: Ditto.
* include/math.h: Ditto.
* include/process.h: Ditto.
* include/stdio.h: Ditto.
* include/stdlib.h: Ditto.
* include/string.h: Ditto.
* include/sys/stat.h: Ditto.
* include/sys/types.h: Ditto.
* include/sys/utime.h: Ditto.
* include/tchar.h: Ditto.
* include/time.h: Ditto.
* include/wchar.h: Ditto.
* include/wctype.h: Ditto.
* src/libcrt/crt/crt1.c: Ditto.
* src/libcrt/crt/init.c: Ditto.
* lib/lib32/moldname.def.in: Remove filters for __CRTDLL__.
* src/libcrt/tlssup.c: Remove filter for CRTDLL.
2012-09-07 Earnie Boyd <earnie@users.sourceforge.net>
+ Remove filters for CRTDLL and __MSVCRT__.
+
+ * Makefile.in: Remove -[DU]__MSVCRT__ and -[DU]__CRTDLL__.
+ * crt1.o: Remove CRTDLL specific target.
+ * dllcrt1.o: Ditto.
+ * gcrt1.o: Ditto.
+ * include/assert.h: Modify documentation to remove the use of CRTDLL.
+ * include/setjmp.h: Ditto.
+ * src/libcrt/crt/ofmt_stub.s: Ditto.
+ * include/ctype.h: Ditto.
+ Remove filters for __MSVCRT__ and unneeded #else coding.
+ * include/dirent.h: Ditto.
+ * include/dos.h: Ditto.
+ * include/io.h: Ditto.
+ * include/math.h: Ditto.
+ * include/process.h: Ditto.
+ * include/stdio.h: Ditto.
+ * include/stdlib.h: Ditto.
+ * include/string.h: Ditto.
+ * include/sys/stat.h: Ditto.
+ * include/sys/types.h: Ditto.
+ * include/sys/utime.h: Ditto.
+ * include/tchar.h: Ditto.
+ * include/time.h: Ditto.
+ * include/wchar.h: Ditto.
+ * include/wctype.h: Ditto.
+ * src/libcrt/crt/crt1.c: Ditto.
+ * src/libcrt/crt/init.c: Ditto.
+ * lib/lib32/moldname.def.in: Remove filters for __CRTDLL__.
+ * src/libcrt/tlssup.c: Remove filter for CRTDLL.
+
+2012-09-07 Earnie Boyd <earnie@users.sourceforge.net>
+
Apply LICENSE to all files as appropriate.
* tests/Makefile.in: Add file preamble.
$(CC) -DRUNTIME=$(basename $(notdir $@)) \
-D__FILENAME__=$@ \
-D__$(basename $(notdir $@))__=1 \
- -D__MSVCRT__ -C -E -P -xc-header \
+ -C -E -P -xc-header \
$? > $@
$(CC) -DRUNTIME=$(basename $(notdir $@)) \
-D__FILENAME__=$$F \
-D__$(basename $(notdir $@))__=1 \
- -D__MSVCRT__ -C -E -P -xc-header \
+ -C -E -P -xc-header \
$? > $@
SRCDIR := lib/lib32
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
SRCDIR := src/libcrt/crt
-$(SRCDIR)/crt1.o $(SRCDIR)/dllcrt1.o:
- $(MKDIR_P) $(@D)
- $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -U__MSVCRT__ -D__CRTDLL__ -o $@ $<
-
$(SRCDIR)/crt2.o $(SRCDIR)/dllcrt2.o:
$(MKDIR_P) $(@D)
- $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -D__MSVCRT__ -U__CRTDLL__ -o $@ $<
+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
$(SRCDIR)/crt1.o: $(SRCDIR)/crt1.c
$(SRCDIR)/dllcrt1.o: $(SRCDIR)/dllcrt1.c
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(scrnsavw_o_CFLAGS) -o $@ $<
SRCDIR := misc/gpl/profile
-$(SRCDIR)/gcrt1.o:
- mkdir -p $(@D)
- $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -U__MSVCRT__ -D__CRTDLL__ -o $@ $<
-
$(SRCDIR)/gcrt2.o:
mkdir -p $(@D)
- $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -D__MSVCRT__ -U__CRTDLL__ -o $@ $<
+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
$(SRCDIR)/gcrt1.o $(SRCDIR)/gcrt2.o: $(SRCDIR)/gcrt0.c
#else /* debugging enabled */
/*
- * CRTDLL nicely supplies a function which does the actual output and
+ * The runtime nicely supplies a function which does the actual output and
* call to abort.
*/
_CRTIMP void __cdecl __MINGW_NOTHROW _assert (const char*, const char*, int) __MINGW_ATTRIB_NORETURN;
/*
* NOTE: The above are not old name type wrappers, but functions exported
- * explicitly by MSVCRT/CRTDLL. However, underscored versions are also
+ * explicitly by MSVCRT.DLL. However, underscored versions are also
* exported.
*/
#ifndef __STRICT_ANSI__
/* Also defined in stdlib.h */
#ifndef MB_CUR_MAX
#ifdef __DECLSPEC_SUPPORTED
-# ifdef __MSVCRT__
-# define MB_CUR_MAX __mb_cur_max
__MINGW_IMPORT int __mb_cur_max;
-# else /* not __MSVCRT */
-# define MB_CUR_MAX __mb_cur_max_dll
- __MINGW_IMPORT int __mb_cur_max_dll;
-# endif /* not __MSVCRT */
-
+# define MB_CUR_MAX __mb_cur_max
#else /* ! __DECLSPEC_SUPPORTED */
-# ifdef __MSVCRT__
extern int* _imp____mb_cur_max;
# define MB_CUR_MAX (*_imp____mb_cur_max)
-# else /* not __MSVCRT */
- extern int* _imp____mb_cur_max_dll;
-# define MB_CUR_MAX (*_imp____mb_cur_max_dll)
-# endif /* not __MSVCRT */
#endif /* __DECLSPEC_SUPPORTED */
#endif /* MB_CUR_MAX */
# if __MSVCRT_VERSION__ <= 0x0700
__MINGW_IMPORT unsigned short _ctype[];
# endif
-# ifdef __MSVCRT__
__MINGW_IMPORT unsigned short* _pctype;
-# else /* CRTDLL */
- __MINGW_IMPORT unsigned short* _pctype_dll;
-# define _pctype _pctype_dll
-# endif
#else /* __DECLSPEC_SUPPORTED */
# if __MSVCRT_VERSION__ <= 0x0700
extern unsigned short** _imp___ctype;
# define _ctype (*_imp___ctype)
# endif
-# ifdef __MSVCRT__
extern unsigned short** _imp___pctype;
# define _pctype (*_imp___pctype)
-# else /* CRTDLL */
- extern unsigned short** _imp___pctype_dll;
-# define _pctype (*_imp___pctype_dll)
-# endif /* CRTDLL */
#endif /* __DECLSPEC_SUPPORTED */
/*
#ifndef _WDIRECT_DEFINED
/* wide character versions. Also in wchar.h */
-#ifdef __MSVCRT__
_CRTIMP int __cdecl __MINGW_NOTHROW _wchdir(const wchar_t*);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetcwd(wchar_t*, int);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetdcwd(int, wchar_t*, int);
_CRTIMP int __cdecl __MINGW_NOTHROW _wmkdir(const wchar_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wrmdir(const wchar_t*);
-#endif /* __MSVCRT__ */
#define _WDIRECT_DEFINED
#endif
extern "C" {
#endif
-#ifndef __MSVCRT__ /* these are in CRTDLL, but not MSVCRT */
-#ifndef __DECLSPEC_SUPPORTED
-extern unsigned int *_imp___basemajor_dll;
-extern unsigned int *_imp___baseminor_dll;
-extern unsigned int *_imp___baseversion_dll;
-extern unsigned int *_imp___osmajor_dll;
-extern unsigned int *_imp___osminor_dll;
-extern unsigned int *_imp___osmode_dll;
-
-#define _basemajor (*_imp___basemajor_dll)
-#define _baseminor (*_imp___baseminor_dll)
-#define _baseversion (*_imp___baseversion_dll)
-#define _osmajor (*_imp___osmajor_dll)
-#define _osminor (*_imp___osminor_dll)
-#define _osmode (*_imp___osmode_dll)
-
-#else /* __DECLSPEC_SUPPORTED */
-
-__MINGW_IMPORT unsigned int _basemajor_dll;
-__MINGW_IMPORT unsigned int _baseminor_dll;
-__MINGW_IMPORT unsigned int _baseversion_dll;
-__MINGW_IMPORT unsigned int _osmajor_dll;
-__MINGW_IMPORT unsigned int _osminor_dll;
-__MINGW_IMPORT unsigned int _osmode_dll;
-
-#define _basemajor _basemajor_dll
-#define _baseminor _baseminor_dll
-#define _baseversion _baseversion_dll
-#define _osmajor _osmajor_dll
-#define _osminor _osminor_dll
-#define _osmode _osmode_dll
-
-#endif /* __DECLSPEC_SUPPORTED */
-#endif /* ! __MSVCRT__ */
-
#ifndef _DISKFREE_T_DEFINED
/* needed by _getdiskfree (also in direct.h) */
struct _diskfree_t {
_CRTIMP char* __cdecl __MINGW_NOTHROW _mktemp (char*);
_CRTIMP int __cdecl __MINGW_NOTHROW _rmdir (const char*);
_CRTIMP int __cdecl __MINGW_NOTHROW _chmod (const char*, int);
-#ifdef __MSVCRT__
_CRTIMP __int64 __cdecl __MINGW_NOTHROW _filelengthi64(int);
#if __MSVCRT_VERSION__ < 0x0800
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirsti64(const char*, struct _finddatai64_t*);
}
#endif
-#endif /* __MSVCRT__ */
-
#ifndef _NO_OLDNAMES
#ifndef _UWIN
_CRTIMP int __cdecl __MINGW_NOTHROW _write (int, const void*, unsigned int);
/* Wide character versions. Also declared in wchar.h. */
-/* Not in crtdll.dll */
#if !defined (_WIO_DEFINED)
-#if defined (__MSVCRT__)
_CRTIMP int __cdecl __MINGW_NOTHROW _waccess(const wchar_t*, int);
_CRTIMP int __cdecl __MINGW_NOTHROW _wchmod(const wchar_t*, int);
_CRTIMP int __cdecl __MINGW_NOTHROW _wcreat(const wchar_t*, int);
_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnexti64 (intptr_t _v1, struct _wfinddatai64_t* _v2) { return(_wfindnext32i64 (_v1,(struct _wfinddata32i64_t*)_v2)); }
#endif /* !_USE_32BIT_TIME_T */
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
-#endif /* defined (__MSVCRT__) */
#define _WIO_DEFINED
#endif /* _WIO_DEFINED */
* __imp__HUGE is a pointer to the actual variable _HUGE in
* MSVCRT.DLL. If we used _HUGE directly we would get a pointer
* to a thunk function.
- *
- * NOTE: The CRTDLL version uses _HUGE_dll instead.
*/
#if __MINGW_GNUC_PREREQ(3, 3)
#ifndef __DECLSPEC_SUPPORTED
-#ifdef __MSVCRT__
extern double* _imp___HUGE;
#define HUGE_VAL (*_imp___HUGE)
-#else
-/* CRTDLL */
-extern double* _imp___HUGE_dll;
-#define HUGE_VAL (*_imp___HUGE_dll)
-#endif
#else /* __DECLSPEC_SUPPORTED */
-#ifdef __MSVCRT__
__MINGW_IMPORT double _HUGE;
#define HUGE_VAL _HUGE
-#else
-/* CRTDLL */
-__MINGW_IMPORT double _HUGE_dll;
-#define HUGE_VAL _HUGE_dll
-#endif
#endif /* __DECLSPEC_SUPPORTED */
#endif /* __MINGW_GNUC_PREREQ(3, 3) */
#endif
/*
- * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
- * They are provided by MSVCRT.
- *
* NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
* making for race conditions if you are not careful. Basically you have to
* make sure that no-one is going to do *anything* with the thread handle
_beginthread (void (*)(void *), unsigned, void*);
_CRTIMP void __cdecl __MINGW_NOTHROW _endthread (void);
-#ifdef __MSVCRT__
_CRTIMP unsigned long __cdecl __MINGW_NOTHROW
_beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *),
void*, unsigned, unsigned*);
_CRTIMP void __cdecl __MINGW_NOTHROW _endthreadex (unsigned);
-#endif
-
#ifndef _NO_OLDNAMES
/*
typedef _JBTYPE jmp_buf[_JBLEN];
/*
- * The function provided by CRTDLL which appears to do the actual work
+ * The function provided by MSVCRT.DLL which appears to do the actual work
* of setjmp.
*/
_CRTIMP int __cdecl __MINGW_NOTHROW _setjmp (jmp_buf);
* this type are unknown, but we (the compiler) need to know the size
* because the programmer using fgetpos and fsetpos will be setting aside
* storage for fpos_t structres. Actually I tested using a byte array and
- * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL).
- * Perhaps an unsigned long? TODO? It's definitely a 64-bit number in
+ * it is fairly evident that the fpos_t it's a 64-bit number in
* MSVCRT however, and for now `long long' will do.
*/
-#ifdef __MSVCRT__
typedef long long fpos_t;
-#else
-typedef long fpos_t;
-#endif
_CRTIMP int __cdecl __MINGW_NOTHROW fgetpos (FILE*, fpos_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW fsetpos (FILE*, const fpos_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW _fileno (FILE*);
_CRTIMP int __cdecl __MINGW_NOTHROW _fcloseall (void);
_CRTIMP FILE* __cdecl __MINGW_NOTHROW _fsopen (const char*, const char*, int);
-#ifdef __MSVCRT__
_CRTIMP int __cdecl __MINGW_NOTHROW _getmaxstdio (void);
_CRTIMP int __cdecl __MINGW_NOTHROW _setmaxstdio (int);
-#endif
#if __MSVCRT_VERSION__ >= 0x800
_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _get_output_format (void);
#define fileno(__F) ((__F)->_file)
#endif
-#if defined (__MSVCRT__) && !defined (__NO_MINGW_LFS)
+#if !defined (__NO_MINGW_LFS)
#include <sys/types.h>
__CRT_INLINE FILE* __cdecl __MINGW_NOTHROW fopen64 (const char*, const char*);
__CRT_INLINE FILE* __cdecl __MINGW_NOTHROW fopen64 (const char* filename, const char* mode)
#ifdef __USE_MINGW_FSEEK
int __cdecl __MINGW_NOTHROW __mingw_fseeko64 (FILE *, off64_t, int);
#define fseeko64(fp, offset, whence) __mingw_fseeko64(fp, offset, whence)
-#endif
+#endif /* __USER_MINGW_FSEEK */
__CRT_INLINE off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE *);
__CRT_INLINE off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE * stream)
_CRTIMP int __cdecl __MINGW_NOTHROW vswprintf (wchar_t*, const wchar_t*, __VALIST);
#endif
-#ifdef __MSVCRT__
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*);
_CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*);
_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*);
_CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*);
_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*);
#endif /* __STRICT_ANSI__ */
-#endif /* __MSVCRT__ */
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int __cdecl __MINGW_NOTHROW snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...);
#endif /* _WSTDIO_DEFINED */
#ifndef __STRICT_ANSI__
-#ifdef __MSVCRT__
#ifndef NO_OLDNAMES
_CRTIMP FILE* __cdecl __MINGW_NOTHROW wpopen (const wchar_t*, const wchar_t*);
#endif /* not NO_OLDNAMES */
-#endif /* MSVCRT runtime */
/*
* Other Non ANSI wide functions
extern char** _argv;
/* imports from runtime dll of the above variables */
-#ifdef __MSVCRT__
extern int* __cdecl __MINGW_NOTHROW __p___argc(void);
extern char*** __cdecl __MINGW_NOTHROW __p___argv(void);
#define __argv (*__p___argv())
#define __wargv (*__p___wargv())
-#else /* !MSVCRT */
-
-#ifndef __DECLSPEC_SUPPORTED
-
-extern int* _imp____argc_dll;
-extern char*** _imp____argv_dll;
-#define __argc (*_imp____argc_dll)
-#define __argv (*_imp____argv_dll)
-
-#else /* __DECLSPEC_SUPPORTED */
-
-__MINGW_IMPORT int __argc_dll;
-__MINGW_IMPORT char** __argv_dll;
-#define __argc __argc_dll
-#define __argv __argv_dll
-
-#endif /* __DECLSPEC_SUPPORTED */
-
-#endif /* __MSVCRT */
#endif /* __STRICT_ANSI__ */
/*
* Also defined in ctype.h.
*/
#ifndef MB_CUR_MAX
#ifdef __DECLSPEC_SUPPORTED
-# ifdef __MSVCRT__
# define MB_CUR_MAX __mb_cur_max
__MINGW_IMPORT int __mb_cur_max;
-# else /* not __MSVCRT */
-# define MB_CUR_MAX __mb_cur_max_dll
- __MINGW_IMPORT int __mb_cur_max_dll;
-# endif /* not __MSVCRT */
-
#else /* ! __DECLSPEC_SUPPORTED */
-# ifdef __MSVCRT__
extern int* _imp____mb_cur_max;
# define MB_CUR_MAX (*_imp____mb_cur_max)
-# else /* not __MSVCRT */
- extern int* _imp____mb_cur_max_dll;
-# define MB_CUR_MAX (*_imp____mb_cur_max_dll)
-# endif /* not __MSVCRT */
#endif /* __DECLSPEC_SUPPORTED */
#endif /* MB_CUR_MAX */
* Use environ from the DLL, not as a global.
*/
-#ifdef __MSVCRT__
extern _CRTIMP char *** __cdecl __MINGW_NOTHROW __p__environ(void);
extern _CRTIMP wchar_t *** __cdecl __MINGW_NOTHROW __p__wenviron(void);
# define _environ (*__p__environ())
# define _wenviron (*__p__wenviron())
-#else /* ! __MSVCRT__ */
-# ifndef __DECLSPEC_SUPPORTED
- extern char *** _imp___environ_dll;
-# define _environ (*_imp___environ_dll)
-# else /* __DECLSPEC_SUPPORTED */
- __MINGW_IMPORT char ** _environ_dll;
-# define _environ _environ_dll
-# endif /* __DECLSPEC_SUPPORTED */
-#endif /* ! __MSVCRT__ */
#define environ _environ
-#ifdef __MSVCRT__
/* One of the MSVCRTxx libraries */
#ifndef __DECLSPEC_SUPPORTED
# endif /* _UWIN */
#endif /* __DECLSPEC_SUPPORTED */
-#else /* ! __MSVCRT__ */
-
-/* CRTDLL run time library */
-
-#ifndef __DECLSPEC_SUPPORTED
- extern int* _imp___sys_nerr_dll;
-# define sys_nerr (*_imp___sys_nerr_dll)
-#else /* __DECLSPEC_SUPPORTED */
- __MINGW_IMPORT int _sys_nerr_dll;
-# define sys_nerr _sys_nerr_dll
-#endif /* __DECLSPEC_SUPPORTED */
-
-#endif /* ! __MSVCRT__ */
-
#ifndef __DECLSPEC_SUPPORTED
extern char*** _imp__sys_errlist;
#define sys_errlist (*_imp___sys_errlist)
* OS version and such constants.
*/
-#ifdef __MSVCRT__
-/* msvcrtxx.dll */
-
extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__osver(void);
extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winver(void);
extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winmajor(void);
__MINGW_IMPORT unsigned int _winminor;
#endif /* __DECLSPEC_SUPPORTED */
-#else
-/* Not msvcrtxx.dll, thus crtdll.dll */
-
-#ifndef __DECLSPEC_SUPPORTED
-
-extern unsigned int* _imp___osver_dll;
-extern unsigned int* _imp___winver_dll;
-extern unsigned int* _imp___winmajor_dll;
-extern unsigned int* _imp___winminor_dll;
-
-#define _osver (*_imp___osver_dll)
-#define _winver (*_imp___winver_dll)
-#define _winmajor (*_imp___winmajor_dll)
-#define _winminor (*_imp___winminor_dll)
-
-#else /* __DECLSPEC_SUPPORTED */
-
-__MINGW_IMPORT unsigned int _osver_dll;
-__MINGW_IMPORT unsigned int _winver_dll;
-__MINGW_IMPORT unsigned int _winmajor_dll;
-__MINGW_IMPORT unsigned int _winminor_dll;
-
-#define _osver _osver_dll
-#define _winver _winver_dll
-#define _winmajor _winmajor_dll
-#define _winminor _winminor_dll
-#endif /* __DECLSPEC_SUPPORTED */
-
-#endif
-
-#if defined __MSVCRT__
/* although the _pgmptr is exported as DATA,
* be safe and use the access function __p__pgmptr() to get it. */
_CRTIMP char** __cdecl __MINGW_NOTHROW __p__pgmptr(void);
#define _pgmptr (*__p__pgmptr())
_CRTIMP wchar_t** __cdecl __MINGW_NOTHROW __p__wpgmptr(void);
#define _wpgmptr (*__p__wpgmptr())
-#else /* ! __MSVCRT__ */
-# ifndef __DECLSPEC_SUPPORTED
- extern char** __imp__pgmptr_dll;
-# define _pgmptr (*_imp___pgmptr_dll)
-# else /* __DECLSPEC_SUPPORTED */
- __MINGW_IMPORT char* _pgmptr_dll;
-# define _pgmptr _pgmptr_dll
-# endif /* __DECLSPEC_SUPPORTED */
-/* no wide version in CRTDLL */
-#endif /* __MSVCRT__ */
/*
* This variable determines the default file mode.
*/
#if !defined (__DECLSPEC_SUPPORTED) || defined (__IN_MINGW_RUNTIME)
-#ifdef __MSVCRT__
extern int* _imp___fmode;
#define _fmode (*_imp___fmode)
-#else
-/* CRTDLL */
-extern int* _imp___fmode_dll;
-#define _fmode (*_imp___fmode_dll)
-#endif
#else /* __DECLSPEC_SUPPORTED */
-#ifdef __MSVCRT__
__MINGW_IMPORT int _fmode;
-#else /* ! __MSVCRT__ */
-__MINGW_IMPORT int _fmode_dll;
-#define _fmode _fmode_dll
-#endif /* ! __MSVCRT__ */
#endif /* __DECLSPEC_SUPPORTED */
float __cdecl __MINGW_NOTHROW wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__);
long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
#endif /* __NO_ISOCEXT */
-#ifdef __MSVCRT__
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*);
_CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
_CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
_CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t);
-#endif
#define _WSTDLIB_DEFINED
#endif
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ltow (long, wchar_t*, int);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ultow (unsigned long, wchar_t*, int);
-#ifdef __MSVCRT__
_CRTIMP __int64 __cdecl __MINGW_NOTHROW _atoi64(const char *);
_CRTIMP char* __cdecl __MINGW_NOTHROW _i64toa(__int64, char *, int);
_CRTIMP char* __cdecl __MINGW_NOTHROW _ui64toa(unsigned __int64, char *, int);
_invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler);
# endif /* __MSVCRT_VERSION__ >= 0x800 */
-#endif /* __MSVCRT__ */
#ifndef _NO_OLDNAMES
long long __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int);
unsigned long long __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int);
-#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
long long __cdecl __MINGW_NOTHROW atoll (const char *);
#if !defined (__STRICT_ANSI__)
#endif /* (__NO_INLINE__) */
#endif /* (__STRICT_ANSI__) */
-#endif /* __MSVCRT__ */
-
#endif /* !__NO_ISOCEXT */
#ifndef __STRICT_ANSI__
/*
- * Extra non-ANSI functions provided by the CRTDLL library
+ * Extra non-ANSI functions provided by the runtime library
*/
_CRTIMP char* __cdecl __MINGW_NOTHROW _strerror (const char *);
_CRTIMP void* __cdecl __MINGW_NOTHROW _memccpy (void*, const void*, int, size_t);
_CRTIMP char* __cdecl __MINGW_NOTHROW _strupr (char*);
_CRTIMP void __cdecl __MINGW_NOTHROW _swab (const char*, char*, size_t);
-#ifdef __MSVCRT__
_CRTIMP int __cdecl __MINGW_NOTHROW _strncoll(const char*, const char*, size_t);
_CRTIMP int __cdecl __MINGW_NOTHROW _strnicoll(const char*, const char*, size_t);
-#endif
#ifndef _NO_OLDNAMES
/*
_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsxfrm(wchar_t*, const wchar_t*, size_t);
#ifndef __STRICT_ANSI__
-/*
- * Unicode versions of non-ANSI string functions provided by CRTDLL.
- */
-/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
+/* NOTE: _wcscmpi not provided by MSVCRT.DLL, this define is for portability */
#define _wcscmpi _wcsicmp
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsdup (const wchar_t*);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsset (wchar_t*, wchar_t);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsupr (wchar_t*);
-#ifdef __MSVCRT__
_CRTIMP int __cdecl __MINGW_NOTHROW _wcsncoll(const wchar_t*, const wchar_t*, size_t);
_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
#if __MSVCRT_VERSION__ >= 0x0700
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcserror(int);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW __wcserror(const wchar_t*);
#endif
-#endif
#ifndef _NO_OLDNAMES
/* NOTE: There is no _wcscmpi, but this is for compatibility. */
};
#endif /* _NO_OLDNAMES */
-#if defined (__MSVCRT__)
struct _stati64 {
_dev_t st_dev;
_ino_t st_ino;
__time64_t st_ctime;
};
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
-#endif /* __MSVCRT__ */
#define _STAT_DEFINED
#endif /* _STAT_DEFINED */
#endif /* Not _NO_OLDNAMES */
-#if defined (__MSVCRT__)
#if __MSVCRT_VERSION__ < 0x0800
_CRTIMP int __cdecl __MINGW_NOTHROW _fstati64(int, struct _stati64 *);
_CRTIMP int __cdecl __MINGW_NOTHROW _stati64(const char *, struct _stati64 *);
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
#define _WSTAT_DEFINED
#endif /* _WSTAT_DEFIND */
-#endif /* __MSVCRT__ */
#ifdef __cplusplus
}
#ifndef _DEV_T_
#define _DEV_T_
-#ifdef __MSVCRT__
typedef unsigned int _dev_t;
-#else
-typedef short _dev_t;
-#endif
#ifndef _NO_OLDNAMES
typedef _dev_t dev_t;
/* The wide character version, only available for MSVCRT versions of the
* C runtime library. */
-#ifdef __MSVCRT__
#if __MSVCRT_VERSION__ < 0x0800
_CRTIMP int __cdecl __MINGW_NOTHROW _wutime (const wchar_t*, struct _utimbuf*);
#endif
-#endif /* MSVCRT runtime */
/* These require newer versions of msvcrt.dll (6.10 or higher). */
#if __MSVCRT_VERSION__ >= 0x0601
#define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs))
#define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL)
-#if 1 /* defined __MSVCRT__ */
/*
- * These wide functions not in crtdll.dll.
* Define macros anyway so that _wfoo rather than _tfoo is undefined
*/
#define _ttoi64 _wtoi64
#define _tstat32i64 _wstat32i64
#define _tstat64i32 _wstat64i32
#endif /* __MSVCRT_VERSION__ > 0x0800 */
-#endif /* __MSVCRT__ */
/* dirent structures and functions */
#define _tdirent _wdirent
#define _trmdir _rmdir
#define _tstat _stat
-#if 1 /* defined __MSVCRT__ */
-/* Not in crtdll.dll. Define macros anyway? */
#define _ttoi64 _atoi64
#define _i64tot _i64toa
#define _ui64tot _ui64toa
#define _tstat32i64 _stat32i64
#define _tstat64i32 _stat64i32
#endif /* __MSVCRT_VERSION__ > 0x0800 */
-#endif /* __MSVCRT__ */
/* dirent structures and functions */
#define _tdirent dirent
* _tzname: standard/daylight savings time zone names (an array with two
* elements).
*/
-#ifdef __MSVCRT__
/* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */
extern _CRTIMP int* __cdecl __MINGW_NOTHROW __p__daylight (void);
__MINGW_IMPORT long _timezone;
__MINGW_IMPORT char *_tzname[2];
-#else /* not __MSVCRT (ie. crtdll) */
-
-#ifndef __DECLSPEC_SUPPORTED
-
-extern int* _imp___daylight_dll;
-extern long* _imp___timezone_dll;
-extern char** _imp___tzname;
-
-#define _daylight (*_imp___daylight_dll)
-#define _timezone (*_imp___timezone_dll)
-#define _tzname (*_imp___tzname)
-
-#else /* __DECLSPEC_SUPPORTED */
-
-__MINGW_IMPORT int _daylight_dll;
-__MINGW_IMPORT long _timezone_dll;
-__MINGW_IMPORT char* _tzname[2];
-
-#define _daylight _daylight_dll
-#define _timezone _timezone_dll
-
-#endif /* __DECLSPEC_SUPPORTED */
-
-#endif /* not __MSVCRT__ */
-
#endif /* Not __STRICT_ANSI__ */
#ifndef _NO_OLDNAMES
-
-#ifdef __MSVCRT__
-
/* These go in the oldnames import library for MSVCRT. */
__MINGW_IMPORT int daylight;
__MINGW_IMPORT long timezone;
__MINGW_IMPORT char *tzname[2];
-
-#else /* not __MSVCRT__ */
-
-/* CRTDLL is royally messed up when it comes to these macros.
- TODO: import and alias these via oldnames import library instead
- of macros. */
-
-#define daylight _daylight
-/* NOTE: timezone not defined as macro because it would conflict with
- struct timezone in sys/time.h.
- Also, tzname used to a be macro, but now it's in moldname. */
-__MINGW_IMPORT char *tzname[2];
-
-#endif /* not __MSVCRT__ */
-
#endif /* Not _NO_OLDNAMES */
#ifndef _WTIME_DEFINED
/* wide function prototypes, also declared in wchar.h */
#ifndef __STRICT_ANSI__
-#ifdef __MSVCRT__
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wasctime(const struct tm*);
#if __MSVCRT_VERSION__ < 0x0800
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime(const time_t*);
_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_wctime32 (_v)); }
#endif
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
-#endif /* __MSVCRT__ */
#endif /* __STRICT_ANSI__ */
_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
#define _WTIME_DEFINED
_CRTIMP int __cdecl __MINGW_NOTHROW vswprintf (wchar_t*, const wchar_t*, __VALIST);
#endif
-#ifdef __MSVCRT__
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*);
_CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*);
_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*);
_CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*);
_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*);
#endif /* __STRICT_ANSI__ */
-#endif /* __MSVCRT__ */
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int __cdecl __MINGW_NOTHROW snwprintf (wchar_t*, size_t, const wchar_t*, ...);
float __cdecl __MINGW_NOTHROW wcstof (const wchar_t * __restrict__, wchar_t ** __restrict__);
long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
#endif /* __NO_ISOCEXT */
-#ifdef __MSVCRT__
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*);
_CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
_CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
_CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t);
-#endif
_CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *, wchar_t **, int);
_CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *, wchar_t **, int, _locale_t);
_CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *, wchar_t **, int);
#ifndef _WTIME_DEFINED
#ifndef __STRICT_ANSI__
-#ifdef __MSVCRT__
/* wide function prototypes, also declared in time.h */
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wasctime (const struct tm*);
#if __MSVCRT_VERSION__ < 0x0800
#endif
#endif
-#endif /* __MSVCRT__ */
#endif /* __STRICT_ANSI__ */
_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
#define _WTIME_DEFINED
_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsxfrm(wchar_t*, const wchar_t*, size_t);
#ifndef __STRICT_ANSI__
-/*
- * Unicode versions of non-ANSI functions provided by CRTDLL.
- */
-
-/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
+/* NOTE: _wcscmpi not provided by runtime dll, this define is for portability */
#define _wcscmpi _wcsicmp
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsdup (const wchar_t*);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsset (wchar_t*, wchar_t);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsupr (wchar_t*);
-#ifdef __MSVCRT__
_CRTIMP int __cdecl __MINGW_NOTHROW _wcsncoll(const wchar_t*, const wchar_t*, size_t);
_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
#if __MSVCRT_VERSION__ >= 0x0700
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcserror(int);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW __wcserror(const wchar_t*);
#endif
-#endif
#ifndef _NO_OLDNAMES
/* NOTE: There is no _wcscmpi, but this is for compatibility. */
#endif
/* Wide character versions. Also defined in io.h. */
-/* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also
- applies to other wide character versions? */
#if !defined (_WIO_DEFINED)
-#if defined (__MSVCRT__)
#include <stdint.h> /* For intptr_t. */
_CRTIMP int __cdecl __MINGW_NOTHROW _waccess (const wchar_t*, int);
_CRTIMP int __cdecl __MINGW_NOTHROW _wchmod (const wchar_t*, int);
#endif /* !_USE_32BIT_TIME_T*/
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
-#endif /* defined (__MSVCRT__) */
#define _WIO_DEFINED
#endif /* _WIO_DEFINED */
#ifndef _WDIRECT_DEFINED
/* Also in direct.h */
-#ifdef __MSVCRT__
_CRTIMP int __cdecl __MINGW_NOTHROW _wchdir (const wchar_t*);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetcwd (wchar_t*, int);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetdcwd (int, wchar_t*, int);
_CRTIMP int __cdecl __MINGW_NOTHROW _wmkdir (const wchar_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wrmdir (const wchar_t*);
-#endif /* __MSVCRT__ */
#define _WDIRECT_DEFINED
#endif /* _WDIRECT_DEFINED */
};
#endif /* _NO_OLDNAMES */
-#if defined (__MSVCRT__)
struct _stati64 {
_dev_t st_dev;
_ino_t st_ino;
};
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
-#endif /* __MSVCRT__ */
#define _STAT_DEFINED
#endif /* _STAT_DEFINED */
#if !defined ( _WSTAT_DEFINED)
/* also declared in sys/stat.h */
-#if defined __MSVCRT__
#if __MSVCRT_VERSION__ < 0x0800
_CRTIMP int __cdecl __MINGW_NOTHROW _wstat (const wchar_t*, struct _stat*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wstati64 (const wchar_t*, struct _stati64*);
_CRTALIAS int __cdecl __MINGW_NOTHROW _wstati64 (const wchar_t* _v1, struct _stati64* _v2) { return(_wstat32i64 (_v1,(struct _stat32i64*)_v2)); }
#endif /* !_USE_32BIT_TIME_T */
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
-#endif /* __MSVCRT__ */
#define _WSTAT_DEFINED
#endif /* ! _WSTAT_DEFIND */
# if __MSVCRT_VERSION__ <= 0x0700
__MINGW_IMPORT unsigned short _ctype[];
# endif
-# ifdef __MSVCRT__
__MINGW_IMPORT unsigned short* _pctype;
-# else /* CRTDLL */
- __MINGW_IMPORT unsigned short* _pctype_dll;
-# define _pctype _pctype_dll
-# endif
-
#else /* ! __DECLSPEC_SUPPORTED */
# if __MSVCRT_VERSION__ <= 0x0700
extern unsigned short** _imp___ctype;
# define _ctype (*_imp___ctype)
# endif
-# ifdef __MSVCRT__
extern unsigned short** _imp___pctype;
# define _pctype (*_imp___pctype)
-# else /* CRTDLL */
- extern unsigned short** _imp___pctype_dll;
-# define _pctype (*_imp___pctype_dll)
-# endif /* CRTDLL */
#endif /* __DECLSPEC_SUPPORTED */
close
creat
cwait
-#if !(__CRTDLL__)
daylight DATA
-#endif
dup
dup2
ecvt
swab
tell
tempnam
-#if !(__CRTDLL__)
timezone DATA
-#endif
; export tzname for both. See <time.h>
tzname DATA
tzset
wcsrev
wcsset
wcsupr
-#if !(__CRTDLL__)
wpopen
-#endif
write
; non-ANSI functions declared in math.h
j0
* Must have the correct app type for MSVCRT.
*/
-#ifdef __MSVCRT__
#define __UNKNOWN_APP 0
#define __CONSOLE_APP 1
#define __GUI_APP 2
__MINGW_IMPORT void __set_app_type(int);
-#endif /* __MSVCRT__ */
/* Global _fmode for this .exe, not the one in msvcrt.dll,
The default is set in txtmode.o in libmingw32.a */
/* Override the dllimport'd declarations in stdlib.h */
#undef _fmode
extern int _fmode;
-#ifdef __MSVCRT__
extern int* __p__fmode(void); /* To access the dll _fmode */
-#endif
/*
* Setup the default file handles to have the _CRT_fmode mode, as well as
}
/* Now sync the dll _fmode to the one for this .exe. */
-#ifdef __MSVCRT__
*__p__fmode() = _fmode;
-#else
- *_imp___fmode_dll = _fmode;
-#endif
}
/* This function will be called when a trap occurs. Thanks to Jacob
void
mainCRTStartup (void)
{
-#ifdef __MSVCRT__
__set_app_type (__CONSOLE_APP);
-#endif
__mingw_CRTStartup ();
}
void
WinMainCRTStartup (void)
{
-#ifdef __MSVCRT__
__set_app_type (__GUI_APP);
-#endif
__mingw_CRTStartup ();
}
*/
extern int _CRT_glob;
-#ifdef __MSVCRT__
typedef struct {
int newmode;
} _startupinfo;
extern void __getmainargs (int *, char ***, char ***, int, _startupinfo *);
-#else
-extern void __GetMainArgs (int *, char ***, char ***, int);
-#endif
/*
* Initialize the _argc, _argv and environ variables.
/* The environ variable is provided directly in stdlib.h through
* a dll function call. */
char **dummy_environ;
-#ifdef __MSVCRT__
_startupinfo start_info;
start_info.newmode = 0;
-#endif
/*
* Microsoft's runtime provides a function for doing just that.
*/
-#ifdef __MSVCRT__
(void) __getmainargs (&_argc, &_argv, &dummy_environ, _CRT_glob,
&start_info);
-#else
- /* CRTDLL version */
- (void) __GetMainArgs (&_argc, &_argv, &dummy_environ, _CRT_glob);
-#endif
}
* versions of MSVCRT, (those which do not already advertise availability of
* any exported _get_output_format() function); this will permit _pformat()
* to transparently interoperate with all supported versions of MSVCRT.
- * (Likewise for CRTDLL).
*/
.text
.p2align 1,,4
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
-#ifdef CRTDLL
-#undef CRTDLL
-#endif
-
#include <windows.h>
#include <stdio.h>
#include <memory.h>