* include/io.h: Add _HAVE_32BIT_TIME_T to filters.
* include/sys/stat.h: Ditto.
* include/sys/timeb.h: Ditto.
* include/sys/types.h: Ditto.
* include/wchar.h: Ditto.
* include/time.h: Rework _HAVE_32BIT_TIME_T to always use 64bit time_t
when not defined.
* Makefile.in (extra_OBJECTS): Move to the front of the dependency list.
(%.o : %.s): Create rules.
* lib/lib32/msvcrt.def.in: Remove needless __MSVCRT_VERSION__ filter
and previous endif to continue the previous filter.
* NEWS: New file.
+2012-09-27 Earnie Boyd <earnie@users.sourceforge.net>
+
+ _USE_32BIT_TIME_T resolution and prepare for release.
+
+ * include/io.h: Add _HAVE_32BIT_TIME_T to filters.
+ * include/sys/stat.h: Ditto.
+ * include/sys/timeb.h: Ditto.
+ * include/sys/types.h: Ditto.
+ * include/wchar.h: Ditto.
+ * include/time.h: Rework _HAVE_32BIT_TIME_T to always use 64bit time_t
+ when not defined.
+ * Makefile.in (extra_OBJECTS): Move to the front of the dependency list.
+ (%.o : %.s): Create rules.
+ * lib/lib32/msvcrt.def.in: Remove needless __MSVCRT_VERSION__ filter
+ and previous endif to continue the previous filter.
+ * NEWS: New file.
+
2012-09-26 Earnie Boyd <earnie@users.sourceforge.net>
Make the changes work.
$(libdxerr8_a_SOURCES) \
$(libdxerr9_a_SOURCES)
-all: $(msvcrt_DEF) $(moldname_DEF) $(lib_LIBRARIES) $(bin_LIBRARIES) $(lib_OBJECTS) $(extra_OBJECTS)
+all: $(extra_OBJECTS) $(msvcrt_DEF) $(moldname_DEF) $(lib_LIBRARIES) $(bin_LIBRARIES) $(lib_OBJECTS)
$(msvcrt_DEF): lib/lib32/msvcrt.def.in
N=`echo $@ | sed -e 's|\([a-z]*\)\([0-9]*\).*|\1|'`; \
$(MKDIR_P) $(@D)
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
+%.o : %.s
+ $(MKDIR_P) $(@D)
+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
+
SRCDIR := src/libcrt/crt
$(SRCDIR)/crt2.o $(SRCDIR)/dllcrt2.o:
$(MKDIR_P) $(@D)
--- /dev/null
+mingwrt-4.0
+w32api-4.0
+-----
+We have combined the source libraries for winsup/mingw and winsup/w32api into
+our own repository named mingw.org-wsl. This change allows us to maintain our
+repositories locally and provide the MinGW users a better maintenance plan.
+
+We have a new license for all files that fell into public domain originally. The
+license is now MIT style and is embedded at the top of all files where we were
+able to apply our own license to the file. Files not containing this new
+license are stored in the misc directory in the repository. The move of the
+repository files does not change the location of the distributed files.
+
+All include files now include the _mingw.h file in order to make use of some new
+macros as explained later.
+
+All filters for OS version now check only _WIN32_WINNT and use a named macro as
+defined in the new file include/sdkddkver.h and the filters were moved to the
+end of the file if possible to reduce the noise caused by the filter.
+
+A new macro named __AW() and defined in _mingw.h is used to suffix a symbol with
+the UNICODE versus ANSI A or W declarations and definitions. This reduced the
+number of lines in an include file by significant amounts dependent on the
+number of symbols which are specific to ANSI versus UNICODE.
+
+File include/w32api.h is deprecated and you will receive a warning telling you
+to not use the file.
+
+You should now always define NTDDI_VERSION with the least OS version you wish
+your application to support. We determine a default based on the _WIN32_WINNT
+value suffixed with 0000 (service pack 0). If _WIN32_WINNT is not defined we
+determine a default for it based on WINVER if it is defined or
+_WIN32_WINNT_WIN2K. If NTDDI_VERSION is defined then _WIN32_WINNT is checked
+for a match if defined and give an error if they do not match. If NTDDI_VERSION
+is defined but _WIN32_WINNT not defined _WIN32_WINNT takes on the
+OSDIR(NTDDI_VERSION) value. The windows.h header file will include sdkddkver.h
+but you may need to specify the include in your source.
+
+CRTDLL is no longer supported. We have removed the creation of the library and
+the filters from the code. This also removes startup object files that you
+would have had to specify to the linker. The GCC specs file is already not
+supporting CRTDLL; I do not know when this was removed.
+
+All occurances of __MSVCRT_VERSION__ filters were removed as unneeded. This
+results in the fact that if you do not specify an appropriate -lmsvcr?? library
+where ?? represents the library version number and you use a symbol that is
+only available in a versioned library DLL then you will either receive an error
+during the link step or during runtime. However, this also removes the
+inconsistency between a Microsoft build and the MinGW build in that you do not
+need to define __MSVCRT_VERSION__ correctly.
+
+We now assume that GCC is the only compiler used with the MinGW.org WSL
+(Windows System Libraries) and that the minimum supported version of GCC is
+3.5.4. This allowed for futher code refactoring reducing the number of lines
+in a header file. You will receive an error if a __GNUC__ is not defined or
+if the GCC version isn't 3.5.4.
+
+The build system was revamped in order to take advantage of the combined MinGW
+runtime and w32api source. We will currently continue to release both the
+mingwrt and the w32api library packages for the time being. We will eventually
+do away with the dual release packages and have a release under the
+mingw.org-wsl name.
+
+A new macro _HAVE_32BIT_TIME_T can be used if you are needing _USE_32BIT_TIME_T
+and have a library that contains the symbols (e.g. _localtime32). Otherwise the
+when _USE_32BIT_TIME_T is defined but _HAVE_32BIT_TIME_T the time functions use
+the 64bit time_t functions and type define as appropriate. This allows you to
+use 32bit time_t with msvcrt.dll but it would be slightly slower. Note, I
+have discovered that the SysWOW64/msvcrt.dll contains the 32bit time_t functions
+but we do not deliver libmsvcrt.a with these imports as this is not available on
+all systems. However, you could possibly (needs testing) use the msvcrt.dll
+directly to link against and define _HAVE_32BIT_TIME_T during the compile.
+
+Issues resolved:
+gdtoa/gd_qnan.h: Make NAN constants positive valued.
+Add MemoryBarrier to libmingwex.a.
+Declare _wexec* and _wspawn* functions in include/process.h.
+Declare _strtoi64, _strtoi64_l, _strtoui64, _strtoui64_l, _wcstrtoi64,
+ _wcstrtoi64_l, _wcstrtoui64, _wcstrtoui64_l in include/stdlib.h.
+Declare _wcstrtoi64, _wcstrtoi64_l, _wcstrtoui64, _wcstrtoui64_l in
+ include/wchar.h.
+Add __STRICT_ANSI__ guard for _getws, _putws, _wfdpen, _wfopen, _wfsopen,
+ _wtmpnam, _wtempnam, _wrename, _wremove, _wperror, _wpopen and PATH_MAX.
+Declare _lock_file and _unlock_file in include/stdio.h.
+When setting default for MAXPATHLEN make sure that PATH_MAX is defined before
+ using it in include/sys/param.h.
+Declare threadlocalinfostruct, threadmbinfostruct, *pthreadlocinfo,
+ *pthreadmbcinfo, _locale_tstruct, and *_locale_t in include/_mingw.h.
+Resolve an issue with tsearch.c.
+Some preparation for _WIN64.
+Performance improvements in libmingwex.a dirent.c code.
+Correct _wfindfirst, _wfindnext, _wfindfirst32, _wfindnext32, _wfindfirsti64
+ _wfindnexti64, _wfindfirst32i64, _wfindfirst64i32, _wfindnext32i64,
+ _wfindnext64i32, _wfindnext64 to use intptr_t in include/io.h.
+Add inline definitions for getc, putc, getchar, putchar, fopen64 and ftello64
+ in include/stdio.h.
+Reapply fix for __dyn_tls_init.
+Handling of errno in mingwex is more POSIX conformant.
+Redefine the structure for dirent and _wdirent to include d_type and be
+ copesetic to Microsoft attributes.
+Declare DIR and _WDIR as opaque data types.
+__dirstream_t and __wdirstream_t are moved to mingwex dirent.c.
+Add MemoryBarrier to include/winnt.h.
+Correct declaration of VerQueryValue[AW] based on MSDN in include/winver.h.
+Correct typos in include/setupapi.h.
+Correct dwItemData definition for tagMENUITMEINFO[AW] in include/winuser.h.
+Add declaration of WTSVirtualChannelClose, WTSVirtualChannelOpen,
+ WTSVirtualChannelOpenEx, WTSVirtualChannelPurgeInput,
+ WTSVirtualChannelPurgeOutput, WTSVirtualChannelQuery, WTSVirtualChannelRead,
+ and WTSVirtualChannelWrite in include/wtsapi32.h.
+Add import symbols WTSVirtualChannelOpenEx@12 to wtsapi32.def.
+Do not deliver amvideo.h and amaudio.h due to incomplete dependencies.
+Add delivery of include/sdkddkver.h.
+Correct OS version guard for GetModuleHandleEx[AW].
+Add delivery of include/shobjidl.h.
+Reorder IP_LOCAL_BINDING definition before IP_ADAPTER_BINDING_INFO.
+Default OS version is now Windows 2000 service pack 0.
+Define JOB_OBJECT_LIMIT_BREAKAWAY_OK, JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK in
+ include/winnt.h.
+Define JOB_OBJECT_BREAKAWAY_OK as JOB_OBJECT_LIMIT_BREAKAWAY_OK and deprecate.
+Define JOB_OBJECT_SILENT_BREAKAWAY as JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK and
+ deprecate.
+Define PROCESS_QUERY_LIMITED_INFORMATION in include/winnt.h.
+Define MAPVK_* in include/winuser.h.
+Resolve typo for IMAGE_DLLCHARACTERISTICS_* in include/winnt.h.
+Deprecate IMAGE_DLL_CHARACTERISTICS_*.
+Define SIO_UDP_CONNRESET in include/winsock2.h.
+Correct GCP_RESULTSW definition in include/wingdi.h.
+Define STACK_SIZE_PARAM_IS_A_RESERVATION in include/winbase.h.
+Removed PACKED macro from incldue/windef.h.
+Replace PACKED in include/wincon.h with __attribute__((packed)).
+Correct PREAD_PROCESS_MEMORY_ROUTINE definition in include/imagehlp.h.
+Define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS in include/winnt.h.
+Some new functions and definitions in include/userenv.h.
_fsize_t size;
char name[FILENAME_MAX];
};
-#ifdef _USE_32BIT_TIME_T
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
#define _finddata_t _finddata32_t
#define _finddatai64_t _finddata32i64_t
#define _findfirst _findfirst32
__int32 size;
wchar_t name[FILENAME_MAX];
};
-#ifdef _USE_32BIT_TIME_T
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
#define _wfinddata_t _wfinddata32_t
#define _wfinddatai64_t _wfinddata32i64_t
#define _wfindfirst _wfindfirst32
};
#define __stat64 _stat64
-#ifdef _USE_32BIT_TIME_T
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
#define _fstat _fstat32
#define _fstati64 _fstat32i64
#define _stat _stat32
#endif
#if !defined(_NO_OLDNAMES) && !defined(__STRICT_ANSI__)
-#ifdef _USE_32BIT_TIME_T
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
#define stat(a,b) _stat32(a,b)
#define fstat(a,b) _fstat32(a,b)
#else
#define _wstat64i32 _wstat64
#endif
-#ifdef _USE_32BIT_TIME_T
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
#define _wstat _wstat32
#define _wstati64 _wstat32i64
#else /* !_USE_32BIT_TIME_T */
_CRTIMP void __cdecl __MINGW_NOTHROW _ftime32 (struct __timeb32*);
-#ifndef _USE_32BIT_TIME_T
-_CRTALIAS void __cdecl __MINGW_NOTHROW _ftime (struct _timeb* _v) { return(_ftime64 ((struct __timeb64*)_v)); }
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+_CRTALIAS void __cdecl __MINGW_NOTHROW _ftime (struct _timeb* _v) { return(_ftime32 ((struct __timeb32*)_v)); }
#else
-_CRTALIAS void __cdecl __MINGW_NOTHROW _ftime (struct _timeb* _v) { return(_ftime32 ((struct __timeb32*)_v)); }
+_CRTALIAS void __cdecl __MINGW_NOTHROW _ftime (struct _timeb* _v) { return(_ftime64 ((struct __timeb64*)_v)); }
#endif
#ifdef __cplusplus
#ifndef _TIME_T_DEFINED
/* FIXME __STRICT_ANSI__ ! */
-#ifndef _USE_32BIT_TIME_T
-typedef __time64_t time_t;
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+typedef __time32_t time_t;
#else
-typedef __time32_t time_t;
-#endif /* !_USE_32BIT_TIME_T */
+typedef __time64_t time_t;
+#endif /* _USE_32BIT_TIME_T */
#define _TIME_T_DEFINED
#endif
#endif
#ifndef _TIME_T_DEFINED
-# ifndef _USE_32BIT_TIME_T
- typedef __time64_t time_t;
-# else
+# if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
typedef __time32_t time_t;
-# endif /* !_USE_32BIT_TIME_T */
+# else
+ typedef __time64_t time_t;
+# endif /* _USE_32BIT_TIME_T */
# define _TIME_T_DEFINED
#endif
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _gmtime32 (const __time32_t*);
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _localtime32 (const __time32_t*);
-#ifndef _USE_32BIT_TIME_T
-_CRTALIAS time_t __cdecl __MINGW_NOTHROW time (time_t* _v) { return(_time64 (_v)); }
-_CRTALIAS double __cdecl __MINGW_NOTHROW difftime (time_t _v1, time_t _v2) { return(_difftime64 (_v1,_v2)); }
-_CRTALIAS time_t __cdecl __MINGW_NOTHROW mktime (struct tm* _v) { return(_mktime64 (_v)); }
-_CRTALIAS time_t __cdecl __MINGW_NOTHROW _mkgmtime (struct tm* _v) { return(_mkgmtime64 (_v)); }
-_CRTALIAS char* __cdecl __MINGW_NOTHROW ctime (const time_t* _v) { return(_ctime64 (_v)); }
-_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t* _v) { return(_gmtime64 (_v)); }
-_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t* _v) { return(_localtime64 (_v)); }
-#else
-#ifdef _HAVE_32BIT_TIME_T
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
_CRTALIAS time_t __cdecl __MINGW_NOTHROW time (time_t* _v) { return(_time32 (_v)); }
_CRTALIAS double __cdecl __MINGW_NOTHROW difftime (time_t _v1, time_t _v2) { return(_difftime32 (_v1,_v2)); }
_CRTALIAS time_t __cdecl __MINGW_NOTHROW mktime (struct tm* _v) { return(_mktime32 (_v)); }
_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t* _v) { return(_gmtime32 (_v)); }
_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t* _v) { return(_localtime32 (_v)); }
#else
-_CRTALIAS time_t __cdecl __MINGW_NOTHROW time (time_t* _v) { return((__time32_t)_time64 ((__time64_t)_v)); }
-_CRTALIAS double __cdecl __MINGW_NOTHROW difftime (time_t _v1, time_t _v2) { return(_difftime64 ((__time64_t)_v1,(__time64_t)_v2)); }
-_CRTALIAS time_t __cdecl __MINGW_NOTHROW mktime (struct tm* _v) { return((__time32_t)_mktime64 (_v)); }
-_CRTALIAS time_t __cdecl __MINGW_NOTHROW _mkgmtime (struct tm* _v) { return((__time32_t)_mkgmtime64 (_v)); }
-_CRTALIAS char* __cdecl __MINGW_NOTHROW ctime (const time_t* _v) { return(_ctime64 ((__time64_t)_v)); }
-_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t* _v) { return(_gmtime64 ((__time64_t)_v)); }
-_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t* _v) { return(_localtime64 ((__time64_t)_v)); }
-#endif /* _HAVE_32BIT_TIME_T */
-#endif /* !_USE_32BIT_TIME_T */
+_CRTALIAS time_t __cdecl __MINGW_NOTHROW time (time_t* _v) { return(_time64 (_v)); }
+_CRTALIAS double __cdecl __MINGW_NOTHROW difftime (time_t _v1, time_t _v2) { return(_difftime64 (_v1,_v2)); }
+_CRTALIAS time_t __cdecl __MINGW_NOTHROW mktime (struct tm* _v) { return(_mktime64 (_v)); }
+_CRTALIAS time_t __cdecl __MINGW_NOTHROW _mkgmtime (struct tm* _v) { return(_mkgmtime64 (_v)); }
+_CRTALIAS char* __cdecl __MINGW_NOTHROW ctime (const time_t* _v) { return(_ctime64 (_v)); }
+_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t* _v) { return(_gmtime64 (_v)); }
+_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t* _v) { return(_localtime64 (_v)); }
+#endif /* _USE_32BIT_TIME_T */
/*
* _daylight: non zero if daylight savings time is used.
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime64 (const __time64_t*);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime32 (const __time32_t*);
-#ifndef _USE_32BIT_TIME_T
-_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_wctime64 (_v)); }
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_wctime32 (_v)); }
#else
-_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_wctime32 (_v)); }
+_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_wctime64 (_v)); }
#endif
#endif /* __STRICT_ANSI__ */
_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst32 (const wchar_t*, struct __wfinddata32_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext32 (long, struct __wfinddata32_t*);
-#ifndef _USE_32BIT_TIME_T
-_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2) { return(_wfindfirst64i32 (_v1,(struct _wfinddata64i32_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnext (long _v1, struct _wfinddata_t* _v2) { return(_wfindnext64i32 (_v1,(struct _wfinddata64i32_t*)_v2)); }
-_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2) { return(_wfindfirst64 (_v1,(struct __wfinddata64_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnexti64 (long _v1, struct _wfinddatai64_t* _v2) { return(_wfindnext64 (_v1,(struct __wfinddata64_t*)_v2)); }
-#else
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2) { return(_wfindfirst32 (_v1,(struct __wfinddata32_t*)_v2)); }
_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnext (long _v1, struct _wfinddata_t* _v2) { return(_wfindnext32 (_v1,(struct __wfinddata32_t*)_v2)); }
_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2) { return(_wfindfirst32i64 (_v1,(struct _wfinddata32i64_t*)_v2)); }
_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnexti64 (long _v1, struct _wfinddatai64_t* _v2) { return(_wfindnext32i64 (_v1,(struct _wfinddata32i64_t*)_v2)); }
+#else
+
+_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2) { return(_wfindfirst64i32 (_v1,(struct _wfinddata64i32_t*)_v2)); }
+_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnext (long _v1, struct _wfinddata_t* _v2) { return(_wfindnext64i32 (_v1,(struct _wfinddata64i32_t*)_v2)); }
+_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2) { return(_wfindfirst64 (_v1,(struct __wfinddata64_t*)_v2)); }
+_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnexti64 (long _v1, struct _wfinddatai64_t* _v2) { return(_wfindnext64 (_v1,(struct __wfinddata64_t*)_v2)); }
#endif /* !_USE_32BIT_TIME_T*/
#define _WIO_DEFINED
};
#define __stat64 _stat64
-#ifdef _USE_32BIT_TIME_T
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
#define _fstat _fstat32
#define _fstati64 _fstat32i64
#define _stat _stat32
#define _wstat64i32 _wstat64
#endif
-#ifdef _USE_32BIT_TIME_T
+#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
#define _wstat _wstat32
#define _wstati64 _wstat32i64
#else
#define _wstat _wstat64i32
#define _wstati64 _wstat64
-#endif /* !_USE_32BIT_TIME_T */
+#endif /* _USE_32BIT_TIME_T */
#define _WSTAT_DEFINED
#endif /* _WSTAT_DEFIND */
_ftelli64
_fseeki64_nolock
_ftelli64_nolock
-#endif /* 8.0 */
-#if __MSVCRT_VERSION__ >= 0x0800
_ctime32
_difftime32
_difftime64