Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/msvcrt/cpp.c | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-)
diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index 2e17f62b43..07cde75c98 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -650,6 +650,7 @@ void * __thiscall MSVCRT_type_info_vector_dtor(type_info * _this, unsigned int f }
#if _MSVCR_VER >= 80 + typedef exception bad_alloc; extern const vtable_ptr MSVCRT_bad_alloc_vtable;
@@ -675,9 +676,11 @@ void __thiscall MSVCRT_bad_alloc_dtor(bad_alloc * _this) TRACE("(%p)\n", _this); MSVCRT_exception_dtor(_this); } -#endif + +#endif /* _MSVCR_VER >= 80 */
#if _MSVCR_VER >= 100 + typedef struct { exception e; HRESULT hr; @@ -985,7 +988,8 @@ void __thiscall MSVCRT_improper_scheduler_detach_dtor( TRACE("(%p)\n", _this); MSVCRT_exception_dtor(_this); } -#endif + +#endif /* _MSVCR_VER >= 100 */
#ifndef __GNUC__ void __asm_dummy_vtables(void) { @@ -1583,6 +1587,8 @@ void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *typ } #endif
+#if _MSVCR_VER >= 80 + /********************************************************************* * ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z * ?_is_exception_typeof@@YAHAEBVtype_info@@PEAU_EXCEPTION_POINTERS@@@Z @@ -1669,7 +1675,7 @@ int __cdecl _is_exception_typeof(const type_info *ti, EXCEPTION_POINTERS *ep) #endif
/********************************************************************* - * __clean_type_info_names_internal (MSVCR100.@) + * __clean_type_info_names_internal (MSVCR80.@) */ void CDECL __clean_type_info_names_internal(void *p) { @@ -1688,6 +1694,8 @@ const char * __thiscall type_info_name_internal_method(type_info * _this, struct return MSVCRT_type_info_name(_this); }
+#endif /* _MSVCR_VER >= 80 */ + /* std::exception_ptr class helpers */ typedef struct { @@ -1695,6 +1703,8 @@ typedef struct int *ref; /* not binary compatible with native msvcr100 */ } exception_ptr;
+#if _MSVCR_VER >= 100 + /********************************************************************* * ?__ExceptionPtrCreate@@YAXPAX@Z * ?__ExceptionPtrCreate@@YAXPEAX@Z @@ -1781,6 +1791,8 @@ void __cdecl __ExceptionPtrAssign(exception_ptr *ep, const exception_ptr *assign InterlockedIncrement(ep->ref); }
+#endif /* _MSVCR_VER >= 100 */ + /********************************************************************* * ?__ExceptionPtrRethrow@@YAXPBX@Z * ?__ExceptionPtrRethrow@@YAXPEBX@Z @@ -1803,6 +1815,8 @@ void __cdecl __ExceptionPtrRethrow(const exception_ptr *ep) ep->rec->NumberParameters, ep->rec->ExceptionInformation); }
+#if _MSVCR_VER >= 100 + #ifdef __i386__ static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) { @@ -1925,6 +1939,9 @@ void __cdecl __ExceptionPtrCurrentException(exception_ptr *ep) } #endif
+#endif /* _MSVCR_VER >= 100 */ + +#if _MSVCR_VER >= 110 /********************************************************************* * ?__ExceptionPtrToBool@@YA_NPBX@Z * ?__ExceptionPtrToBool@@YA_NPEBX@Z @@ -1933,6 +1950,9 @@ MSVCRT_bool __cdecl __ExceptionPtrToBool(exception_ptr *ep) { return !!ep->rec; } +#endif + +#if _MSVCR_VER >= 100
/********************************************************************* * ?__ExceptionPtrCopyException@@YAXPAXPBX1@Z @@ -2020,12 +2040,17 @@ MSVCRT_bool __cdecl __ExceptionPtrCompare(const exception_ptr *ep1, const except return ep1->rec == ep2->rec; }
+#endif /* _MSVCR_VER >= 100 */ + +#if _MSVCR_VER >= 80 void* __cdecl __AdjustPointer(void *obj, const this_ptr_offsets *off) { return get_this_pointer(off, obj); } +#endif
#if _MSVCR_VER >= 140 + typedef struct { char *name; @@ -2139,9 +2164,11 @@ MSVCRT_size_t CDECL MSVCRT_type_info_hash(const type_info140 *ti)
return hash; } -#endif + +#endif /* _MSVCR_VER >= 140 */
#if _MSVCR_VER >= 100 + enum ConcRT_EventType { CONCRT_EVENT_GENERIC, @@ -2160,4 +2187,5 @@ void __cdecl Concurrency__Trace_ppl_function(const GUID *guid, unsigned char lev { FIXME("(%s %u %i) stub\n", debugstr_guid(guid), level, type); } -#endif + +#endif /* _MSVCR_VER >= 100 */
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/msvcrt/errno.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/msvcrt/errno.c b/dlls/msvcrt/errno.c index 5693043971..c5fbae21a8 100644 --- a/dlls/msvcrt/errno.c +++ b/dlls/msvcrt/errno.c @@ -188,8 +188,10 @@ void msvcrt_set_errno(int err) } }
+#if _MSVCR_VER >= 80 + /********************************************************************* - * __sys_nerr (MSVCR100.@) + * __sys_nerr (MSVCR80.@) */ int* CDECL __sys_nerr(void) { @@ -197,13 +199,15 @@ int* CDECL __sys_nerr(void) }
/********************************************************************* - * __sys_errlist (MSVCR100.@) + * __sys_errlist (MSVCR80.@) */ char** CDECL __sys_errlist(void) { return MSVCRT__sys_errlist; }
+#endif /* _MSVCR_VER >= 80 */ + /********************************************************************* * _errno (MSVCRT.@) */ @@ -478,8 +482,10 @@ void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_ } }
+#if _MSVCR_VER >= 80 + /********************************************************************* - * _invalid_parameter_noinfo (MSVCR100.@) + * _invalid_parameter_noinfo (MSVCR80.@) */ void CDECL _invalid_parameter_noinfo(void) { @@ -487,7 +493,7 @@ void CDECL _invalid_parameter_noinfo(void) }
/********************************************************************* - * _invalid_parameter_noinfo_noreturn (MSVCR100.@) + * _invalid_parameter_noinfo_noreturn (MSVCR80.@) */ void CDECL _invalid_parameter_noinfo_noreturn(void) { @@ -518,7 +524,10 @@ MSVCRT_invalid_parameter_handler CDECL _set_invalid_parameter_handler( return old; }
+#endif /* _MSVCR_VER >= 80 */ + #if _MSVCR_VER >= 140 + /********************************************************************* * _get_thread_local_invalid_parameter_handler (UCRTBASE.@) */ @@ -542,4 +551,5 @@ MSVCRT_invalid_parameter_handler CDECL _set_thread_local_invalid_parameter_handl data->invalid_parameter_handler = handler; return old; } -#endif + +#endif /* _MSVCR_VER >= 140 */
Signed-off-by: Piotr Caban piotr@codeweavers.com
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/msvcrt/file.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 43c3fc44c4..6d0c1ae60c 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -786,13 +786,15 @@ MSVCRT_FILE * CDECL MSVCRT___iob_func(void) return &MSVCRT__iob[0]; }
+#if _MSVCR_VER >= 140 /********************************************************************* - * __acrt_iob_func(MSVCRT.@) + * __acrt_iob_func(UCRTBASE.@) */ MSVCRT_FILE * CDECL MSVCRT___acrt_iob_func(unsigned idx) { return &MSVCRT__iob[idx]; } +#endif
/********************************************************************* * _access (MSVCRT.@) @@ -3064,8 +3066,10 @@ int CDECL MSVCRT_stat(const char* path, struct MSVCRT__stat * buf) return ret; }
+#if _MSVCR_VER >= 80 + /********************************************************************* - * _stat32 (MSVCR100.@) + * _stat32 (MSVCR80.@) */ int CDECL MSVCRT__stat32(const char *path, struct MSVCRT__stat32 *buf) { @@ -3079,7 +3083,7 @@ int CDECL MSVCRT__stat32(const char *path, struct MSVCRT__stat32 *buf) }
/********************************************************************* - * _stat32i64 (MSVCR100.@) + * _stat32i64 (MSVCR80.@) */ int CDECL MSVCRT__stat32i64(const char *path, struct MSVCRT__stat32i64 *buf) { @@ -3093,7 +3097,7 @@ int CDECL MSVCRT__stat32i64(const char *path, struct MSVCRT__stat32i64 *buf) }
/********************************************************************* - * _stat64i32 (MSVCR100.@) + * _stat64i32 (MSVCR80.@) */ int CDECL MSVCRT__stat64i32(const char* path, struct MSVCRT__stat64i32 *buf) { @@ -3106,6 +3110,8 @@ int CDECL MSVCRT__stat64i32(const char* path, struct MSVCRT__stat64i32 *buf) return ret; }
+#endif /* _MSVCR_VER >= 80 */ + /********************************************************************* * _wstat64 (MSVCRT.@) */ @@ -3203,8 +3209,10 @@ int CDECL MSVCRT__wstat(const MSVCRT_wchar_t* path, struct MSVCRT__stat * buf) return ret; }
+#if _MSVCR_VER >= 80 + /********************************************************************* - * _wstat32 (MSVCR100.@) + * _wstat32 (MSVCR80.@) */ int CDECL MSVCRT__wstat32(const MSVCRT_wchar_t *path, struct MSVCRT__stat32 *buf) { @@ -3218,7 +3226,7 @@ int CDECL MSVCRT__wstat32(const MSVCRT_wchar_t *path, struct MSVCRT__stat32 *buf }
/********************************************************************* - * _wstat32i64 (MSVCR100.@) + * _wstat32i64 (MSVCR80.@) */ int CDECL MSVCRT__wstat32i64(const MSVCRT_wchar_t *path, struct MSVCRT__stat32i64 *buf) { @@ -3232,7 +3240,7 @@ int CDECL MSVCRT__wstat32i64(const MSVCRT_wchar_t *path, struct MSVCRT__stat32i6 }
/********************************************************************* - * _wstat64i32 (MSVCR100.@) + * _wstat64i32 (MSVCR80.@) */ int CDECL MSVCRT__wstat64i32(const MSVCRT_wchar_t *path, struct MSVCRT__stat64i32 *buf) { @@ -3245,6 +3253,8 @@ int CDECL MSVCRT__wstat64i32(const MSVCRT_wchar_t *path, struct MSVCRT__stat64i3 return ret; }
+#endif /* _MSVCR_VER >= 80 */ + /********************************************************************* * _tell (MSVCRT.@) */ @@ -4350,6 +4360,7 @@ MSVCRT_size_t CDECL MSVCRT__fread_nolock(void *ptr, MSVCRT_size_t size, MSVCRT_s return read / size; }
+#if _MSVCR_VER >= 80
/********************************************************************* * fread_s (MSVCR80.@) @@ -4425,6 +4436,8 @@ MSVCRT_size_t CDECL MSVCRT__fread_nolock_s(void *buf, MSVCRT_size_t buf_size, MS return buf_pos/elem_size; }
+#endif /* _MSVCR_VER >= 80 */ + /********************************************************************* * _wfreopen (MSVCRT.@) * @@ -4610,13 +4623,15 @@ LONG CDECL MSVCRT_ftell(MSVCRT_FILE* file) return MSVCRT__ftelli64(file); }
+#if _MSVCR_VER >= 80 /********************************************************************* - * _ftell_nolock (MSVCRT.@) + * _ftell_nolock (MSVCR80.@) */ LONG CDECL MSVCRT__ftell_nolock(MSVCRT_FILE* file) { return MSVCRT__ftelli64_nolock(file); } +#endif
/********************************************************************* * fgetpos (MSVCRT.@) @@ -5213,6 +5228,8 @@ int CDECL MSVCRT_vfwprintf_s(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, __ return MSVCRT__vfwprintf_s_l(file, format, NULL, valist); }
+#if _MSVCR_VER >= 140 + /********************************************************************* * __stdio_common_vfprintf (UCRTBASE.@) */ @@ -5263,6 +5280,8 @@ int CDECL MSVCRT__stdio_common_vfwprintf_s(unsigned __int64 options, MSVCRT_FILE file, format, locale, valist); }
+#endif /* _MSVCR_VER >= 140 */ + /********************************************************************* * _vfprintf_l (MSVCRT.@) */ @@ -5592,6 +5611,7 @@ int CDECL MSVCRT__setmaxstdio(int newmax) return MSVCRT_max_streams; }
+#if _MSVCR_VER >= 140 /********************************************************************* * _get_stream_buffer_pointers (UCRTBASE.@) */ @@ -5606,3 +5626,4 @@ int CDECL MSVCRT__get_stream_buffer_pointers(MSVCRT_FILE *file, char*** base, *count = &file->_cnt; return 0; } +#endif
Signed-off-by: Piotr Caban piotr@codeweavers.com
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/msvcrt/locale.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 6e163114a2..2f119abfec 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -449,8 +449,9 @@ char* CDECL _Getdays(void) return out; }
+#if _MSVCR_VER >= 110 /********************************************************************* - * _W_Getdays (MSVCRT.@) + * _W_Getdays (MSVCR100.@) */ MSVCRT_wchar_t* CDECL _W_Getdays(void) { @@ -481,6 +482,7 @@ MSVCRT_wchar_t* CDECL _W_Getdays(void)
return out; } +#endif
/********************************************************************* * _Getmonths (MSVCRT.@) @@ -515,8 +517,9 @@ char* CDECL _Getmonths(void) return out; }
+#if _MSVCR_VER >= 110 /********************************************************************* - * _W_Getmonths (MSVCRT.@) + * _W_Getmonths (MSVCR100.@) */ MSVCRT_wchar_t* CDECL _W_Getmonths(void) { @@ -547,6 +550,7 @@ MSVCRT_wchar_t* CDECL _W_Getmonths(void)
return out; } +#endif
/********************************************************************* * _Gettnames (MSVCRT.@) @@ -575,6 +579,7 @@ void* CDECL _Gettnames(void) return ret; }
+#if _MSVCR_VER >= 110 /********************************************************************* * _W_Gettnames (MSVCR110.@) */ @@ -582,6 +587,7 @@ void* CDECL _W_Gettnames(void) { return _Gettnames(); } +#endif
/********************************************************************* * __crtLCMapStringA (MSVCRT.@) @@ -644,6 +650,7 @@ int CDECL __crtGetLocaleInfoW( LCID lcid, LCTYPE type, MSVCRT_wchar_t *buffer, i return GetLocaleInfoW( lcid, type, buffer, len ); }
+#if _MSVCR_VER >= 110 /********************************************************************* * __crtGetLocaleInfoEx (MSVC110.@) */ @@ -652,6 +659,7 @@ int CDECL __crtGetLocaleInfoEx( const WCHAR *locale, LCTYPE type, MSVCRT_wchar_t TRACE("(%s, %x, %p, %d)\n", debugstr_w(locale), type, buffer, len); return GetLocaleInfoEx(locale, type, buffer, len); } +#endif
/********************************************************************* * btowc(MSVCRT.@) @@ -709,10 +717,10 @@ LCID* CDECL ___lc_handle_func(void) return get_locinfo()->lc_handle; }
+#if _MSVCR_VER >= 110 /********************************************************************* * ___lc_locale_name_func (MSVCR110.@) */ -#if _MSVCR_VER >= 110 MSVCRT_wchar_t** CDECL ___lc_locale_name_func(void) { return get_locinfo()->lc_name; @@ -1890,6 +1898,7 @@ MSVCRT_wchar_t* CDECL MSVCRT__wsetlocale(int category, const MSVCRT_wchar_t* wlo return ret ? current_lc_all : NULL; }
+#if _MSVCR_VER >= 80 /********************************************************************* * _configthreadlocale (MSVCR80.@) */ @@ -1937,6 +1946,7 @@ int CDECL _configthreadlocale(int type)
return -1; } +#endif
BOOL msvcrt_init_locale(void) {
Signed-off-by: Piotr Caban piotr@codeweavers.com
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/msvcrt/time.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 57657cabcc..b7b76afb31 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -890,6 +890,7 @@ int * CDECL MSVCRT___p__dstbias(void) return &MSVCRT__dstbias; }
+#if _MSVCR_VER >= 80 /********************************************************************* * _get_dstbias (MSVCR80.@) */ @@ -899,6 +900,7 @@ int CDECL MSVCRT__get_dstbias(int *seconds) *seconds = MSVCRT__dstbias; return 0; } +#endif
/********************************************************************* * __p__timezone (MSVCRT.@) @@ -1246,14 +1248,16 @@ einval_error: return 0; }
+#if _MSVCR_VER >= 80 /******************************************************************** - * _strftime_l (MSVCRT.@) + * _strftime_l (MSVCR80.@) */ MSVCRT_size_t CDECL MSVCRT__strftime_l( char *str, MSVCRT_size_t max, const char *format, const struct MSVCRT_tm *mstm, MSVCRT__locale_t loc ) { return strftime_helper(str, max, format, mstm, NULL, loc); } +#endif
/********************************************************************* * _Strftime (MSVCRT.@) @@ -1316,8 +1320,9 @@ MSVCRT_size_t CDECL MSVCRT_wcsftime( MSVCRT_wchar_t *str, MSVCRT_size_t max, return wcsftime_helper(str, max, format, mstm, NULL, NULL); }
+#if _MSVCR_VER >= 110 /********************************************************************* - * _Wcsftime (MSVCRT.@) + * _Wcsftime (MSVCR110.@) */ MSVCRT_size_t CDECL _Wcsftime(MSVCRT_wchar_t *str, MSVCRT_size_t max, const MSVCRT_wchar_t *format, const struct MSVCRT_tm *mstm, @@ -1325,6 +1330,7 @@ MSVCRT_size_t CDECL _Wcsftime(MSVCRT_wchar_t *str, MSVCRT_size_t max, { return wcsftime_helper(str, max, format, mstm, time_data, NULL); } +#endif
static char* asctime_buf(char *buf, const struct MSVCRT_tm *mstm) { @@ -1582,8 +1588,10 @@ int CDECL MSVCRT__wctime32_s(MSVCRT_wchar_t *buf, MSVCRT_size_t size, return MSVCRT__wasctime_s(buf, size, &tm); }
+#if _MSVCR_VER >= 80 + /********************************************************************* - * _get_timezone (MSVCR100.@) + * _get_timezone (MSVCR80.@) */ int CDECL _get_timezone(LONG *timezone) { @@ -1594,7 +1602,7 @@ int CDECL _get_timezone(LONG *timezone) }
/********************************************************************* - * _get_daylight (MSVCR100.@) + * _get_daylight (MSVCR80.@) */ int CDECL _get_daylight(int *hours) { @@ -1603,3 +1611,5 @@ int CDECL _get_daylight(int *hours) *hours = MSVCRT___daylight; return 0; } + +#endif /* _MSVCR_VER >= 80 */
Signed-off-by: Piotr Caban piotr@codeweavers.com
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/msvcrt/exit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/exit.c b/dlls/msvcrt/exit.c index 44b29c133c..d0e93d7b98 100644 --- a/dlls/msvcrt/exit.c +++ b/dlls/msvcrt/exit.c @@ -462,6 +462,7 @@ void CDECL _register_thread_local_exe_atexit_callback(_tls_callback_type callbac tls_atexit_callback = callback; }
+#if _MSVCR_VER>=71 /********************************************************************* * _set_purecall_handler (MSVCR71.@) */ @@ -473,15 +474,18 @@ MSVCRT_purecall_handler CDECL _set_purecall_handler(MSVCRT_purecall_handler func purecall_handler = function; return ret; } +#endif
+#if _MSVCR_VER>=80 /********************************************************************* - * _get_purecall_handler + * _get_purecall_handler (MSVCR80.@) */ MSVCRT_purecall_handler CDECL _get_purecall_handler(void) { TRACE("\n"); return purecall_handler; } +#endif
/********************************************************************* * _purecall (MSVCRT.@)
Signed-off-by: Piotr Caban piotr@codeweavers.com