summaryrefslogtreecommitdiff
path: root/src/pal/inc/rt
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/inc/rt')
-rw-r--r--src/pal/inc/rt/intsafe.h44
-rw-r--r--src/pal/inc/rt/palrt.h51
-rw-r--r--src/pal/inc/rt/safecrt.h8
-rw-r--r--src/pal/inc/rt/sal.h2
-rw-r--r--src/pal/inc/rt/specstrings_strict.h2
-rw-r--r--src/pal/inc/rt/specstrings_undef.h2
-rw-r--r--src/pal/inc/rt/vsassert.h5
7 files changed, 10 insertions, 104 deletions
diff --git a/src/pal/inc/rt/intsafe.h b/src/pal/inc/rt/intsafe.h
index 2ab2cf1..4ed70e7 100644
--- a/src/pal/inc/rt/intsafe.h
+++ b/src/pal/inc/rt/intsafe.h
@@ -38,47 +38,6 @@ UnsignedMultiply128 (
#endif
#endif // _AMD64_
-#ifndef FEATURE_PAL
-
-#ifdef _WIN64
-typedef unsigned __int64 size_t;
-typedef unsigned __int64 UINT_PTR;
-typedef unsigned __int64 ULONG_PTR;
-typedef unsigned __int64 DWORD_PTR;
-typedef unsigned __int64 SIZE_T;
-#else
-typedef __w64 unsigned int size_t;
-typedef __w64 unsigned int UINT_PTR;
-typedef __w64 unsigned long ULONG_PTR;
-typedef __w64 unsigned long DWORD_PTR;
-typedef __w64 unsigned long SIZE_T;
-#endif
-typedef char CHAR;
-typedef int INT;
-typedef long LONG;
-typedef unsigned char UCHAR;
-typedef unsigned short USHORT;
-typedef unsigned short WORD;
-typedef unsigned int UINT;
-typedef unsigned long ULONG;
-typedef unsigned long DWORD;
-typedef unsigned __int64 ULONGLONG;
-
-
-typedef LONG HRESULT;
-
-#ifndef SUCCEEDED
-#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
-#endif
-
-#ifndef FAILED
-#define FAILED(hr) (((HRESULT)(hr)) < 0)
-#endif
-
-#define S_OK ((HRESULT)0x00000000L)
-
-#endif // !FEATURE_PAL
-
#define INTSAFE_E_ARITHMETIC_OVERFLOW ((HRESULT)0x80070216L) // 0x216 = 534 = ERROR_ARITHMETIC_OVERFLOW
#ifndef LOWORD
@@ -93,8 +52,7 @@ typedef LONG HRESULT;
#define LODWORD(_qw) ((ULONG)(_qw))
#if defined(MIDL_PASS) || defined(RC_INVOKED) || defined(_M_CEE_PURE) \
- || defined(_68K_) || defined(_MPPC_) || defined(_PPC_) \
- || defined(_M_IA64) || defined(_M_AMD64) || defined(__ARM_ARCH)
+ || defined(_M_AMD64) || defined(__ARM_ARCH)
#ifndef UInt32x32To64
#define UInt32x32To64(a, b) ((unsigned __int64)((ULONG)(a)) * (unsigned __int64)((ULONG)(b)))
diff --git a/src/pal/inc/rt/palrt.h b/src/pal/inc/rt/palrt.h
index c181f38..059d3a6 100644
--- a/src/pal/inc/rt/palrt.h
+++ b/src/pal/inc/rt/palrt.h
@@ -223,19 +223,11 @@ inline void *__cdecl operator new(size_t, void *_P)
// PAL_safe_offsetof is a version of offsetof that protects against an
// overridden operator&
-#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3)
#define FIELD_OFFSET(type, field) __builtin_offsetof(type, field)
#ifndef offsetof
#define offsetof(type, field) __builtin_offsetof(type, field)
#endif
#define PAL_safe_offsetof(type, field) __builtin_offsetof(type, field)
-#else
-#define FIELD_OFFSET(type, field) (((LONG)(LONG_PTR)&(((type *)64)->field)) - 64)
-#ifndef offsetof
-#define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s *)64)->m)) - 64)
-#endif
-#define PAL_safe_offsetof(s,m) ((size_t)((ptrdiff_t)&(char&)(((s *)64)->m))-64)
-#endif
#define CONTAINING_RECORD(address, type, field) \
((type *)((LONG_PTR)(address) - FIELD_OFFSET(type, field)))
@@ -243,7 +235,7 @@ inline void *__cdecl operator new(size_t, void *_P)
#define ARGUMENT_PRESENT(ArgumentPointer) (\
(CHAR *)(ArgumentPointer) != (CHAR *)(NULL) )
-#if defined(_WIN64) || defined(_M_ALPHA)
+#if defined(_WIN64)
#define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG)
#else
#define MAX_NATURAL_ALIGNMENT sizeof(ULONG)
@@ -893,7 +885,6 @@ Remember to fix the errcode defintion in safecrt.h.
*/
#define _wcslwr_s _wcslwr_unsafe
-#define _snprintf_s _snprintf_unsafe
#define swscanf_s swscanf
#define _wfopen_s _wfopen_unsafe
@@ -903,8 +894,6 @@ Remember to fix the errcode defintion in safecrt.h.
#define _vscprintf _vscprintf_unsafe
-#define vsprintf_s _vsnprintf
-
extern "C++" {
#include <safemath.h>
@@ -959,8 +948,11 @@ inline int __cdecl _vscprintf_unsafe(const char *_Format, va_list _ArgList)
if(buf == nullptr)
return 0;
- int ret = _vsnprintf(buf, guess, _Format, _ArgList);
+ va_list argListCopy;
+ va_copy(argListCopy, _ArgList);
+ int ret = _vsnprintf_s(buf, guess, _TRUNCATE, _Format, argListCopy);
free(buf);
+ va_end(argListCopy);
if ((ret != -1) && (ret < guess))
return ret;
@@ -969,28 +961,6 @@ inline int __cdecl _vscprintf_unsafe(const char *_Format, va_list _ArgList)
}
}
-inline int __cdecl _vsnprintf_unsafe(char *_Dst, size_t _SizeInWords, size_t _Count, const char *_Format, va_list _ArgList)
-{
- if (_Count == _TRUNCATE) _Count = _SizeInWords - 1;
- int ret = _vsnprintf(_Dst, _Count, _Format, _ArgList);
- _Dst[_SizeInWords - 1] = L'\0';
- if (ret < 0 && errno == 0)
- {
- errno = ERANGE;
- }
- return ret;
-}
-
-inline int __cdecl _snprintf_unsafe(char *_Dst, size_t _SizeInWords, size_t _Count, const char *_Format, ...)
-{
- int ret;
- va_list _ArgList;
- va_start(_ArgList, _Format);
- ret = _vsnprintf_unsafe(_Dst, _SizeInWords, _Count, _Format, _ArgList);
- va_end(_ArgList);
- return ret;
-}
-
inline errno_t __cdecl _wfopen_unsafe(PAL_FILE * *ff, const WCHAR *fileName, const WCHAR *mode)
{
PAL_FILE *result = _wfopen(fileName, mode);
@@ -1208,7 +1178,6 @@ typedef VOID (__stdcall *WAITORTIMERCALLBACK)(PVOID, BOOLEAN);
#define _ReturnAddress() __builtin_return_address(0)
-#ifdef PLATFORM_UNIX
#define DIRECTORY_SEPARATOR_CHAR_A '/'
#define DIRECTORY_SEPARATOR_CHAR_W W('/')
#define DIRECTORY_SEPARATOR_STR_A "/"
@@ -1216,15 +1185,6 @@ typedef VOID (__stdcall *WAITORTIMERCALLBACK)(PVOID, BOOLEAN);
#define PATH_SEPARATOR_CHAR_W W(':')
#define PATH_SEPARATOR_STR_W W(":")
#define VOLUME_SEPARATOR_CHAR_W W('/')
-#else // PLATFORM_UNIX
-#define DIRECTORY_SEPARATOR_CHAR_A '\\'
-#define DIRECTORY_SEPARATOR_CHAR_W W('\\')
-#define DIRECTORY_SEPARATOR_STR_A "\\"
-#define DIRECTORY_SEPARATOR_STR_W W("\\")
-#define PATH_SEPARATOR_CHAR_W W(';')
-#define PATH_SEPARATOR_STR_W W(";")
-#define VOLUME_SEPARATOR_CHAR_W W(':')
-#endif // PLATFORM_UNIX
#ifndef IMAGE_IMPORT_DESC_FIELD
#define IMAGE_IMPORT_DESC_FIELD(img, f) ((img).u.f)
@@ -1546,6 +1506,7 @@ typedef struct _DISPATCHER_CONTEXT {
PEXCEPTION_ROUTINE LanguageHandler;
PVOID HandlerData;
PUNWIND_HISTORY_TABLE HistoryTable;
+ BOOLEAN ControlPcIsUnwound;
} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
#else
diff --git a/src/pal/inc/rt/safecrt.h b/src/pal/inc/rt/safecrt.h
index 3cc10ce..92366df 100644
--- a/src/pal/inc/rt/safecrt.h
+++ b/src/pal/inc/rt/safecrt.h
@@ -135,11 +135,7 @@ typedef _W64 unsigned int uintptr_t;
#define _UINTPTR_T_DEFINED
#endif
-#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ >= 3))
#define SAFECRT_DEPRECATED __declspec(deprecated)
-#else
-#define SAFECRT_DEPRECATED
-#endif
/* errno_t */
#if !defined(_ERRCODE_DEFINED)
@@ -3253,10 +3249,6 @@ int __cdecl vswprintf_s(WCHAR (&_Dst)[_SizeInWords], const WCHAR *_Format, va_li
* return -1 if the formatted string does not entirely fit into _Dst (we will not call _SAFECRT_INVALID_PARAMETER);
* if _Count == 0, then (_Dst == nullptr && _SizeInBytes == 0) is allowed
*/
-_SAFECRT__EXTERN_C
-int __cdecl _snprintf_s(char *_Dst, size_t _SizeInBytes, size_t _Count, const char *_Format, ...);
-_SAFECRT__EXTERN_C
-int __cdecl _vsnprintf_s(char *_Dst, size_t _SizeInBytes, size_t _Count, const char *_Format, va_list _ArgList);
#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS
template <size_t _SizeInBytes>
diff --git a/src/pal/inc/rt/sal.h b/src/pal/inc/rt/sal.h
index 0e3eaaa..0746864 100644
--- a/src/pal/inc/rt/sal.h
+++ b/src/pal/inc/rt/sal.h
@@ -2861,7 +2861,7 @@ of each annotation, see the advanced annotations section.
#define __success(expr) _Success_(expr)
#define __nullterminated _Null_terminated_
#define __nullnullterminated
-#define __reserved _SAL1_Source_(__reserved, (), _Reserved_)
+#define __clr_reserved _SAL1_Source_(__reserved, (), _Reserved_)
#define __checkReturn _SAL1_Source_(__checkReturn, (), _Check_return_)
#define __typefix(ctype) _SAL1_Source_(__typefix, (ctype), __inner_typefix(ctype))
#define __override __inner_override
diff --git a/src/pal/inc/rt/specstrings_strict.h b/src/pal/inc/rt/specstrings_strict.h
index 514106e..08d323c 100644
--- a/src/pal/inc/rt/specstrings_strict.h
+++ b/src/pal/inc/rt/specstrings_strict.h
@@ -626,7 +626,7 @@
#define __in_awcount(expr,size) __allowed(on_parameter)
#define __nullterminated _SAL_VERSION_CHECK(__nullterminated)
#define __nullnullterminated _SAL_VERSION_CHECK(__nullnullterminated)
-#define __reserved _SAL_VERSION_CHECK(__reserved)
+#define __clr_reserved _SAL_VERSION_CHECK(__reserved)
#define __checkReturn _SAL_VERSION_CHECK(__checkReturn)
#define __typefix(ctype) __allowed(on_parameter_or_return)
#define __override __allowed(on_function)
diff --git a/src/pal/inc/rt/specstrings_undef.h b/src/pal/inc/rt/specstrings_undef.h
index b462dc2..69fc01c 100644
--- a/src/pal/inc/rt/specstrings_undef.h
+++ b/src/pal/inc/rt/specstrings_undef.h
@@ -445,7 +445,7 @@
#undef __readableTo
#undef __readonly
#undef __refparam
-#undef __reserved
+#undef __clr_reserved
#undef __rpc_entry
#undef __source_code_content
#undef __struct_bcount
diff --git a/src/pal/inc/rt/vsassert.h b/src/pal/inc/rt/vsassert.h
index 1f16cf1..2a7fa5f 100644
--- a/src/pal/inc/rt/vsassert.h
+++ b/src/pal/inc/rt/vsassert.h
@@ -11,10 +11,6 @@
#ifndef __VSASSERT_H__
#define __VSASSERT_H__
-#ifndef FEATURE_PAL
-#error "FEATURE_PAL must be defined for this file"
-#else // FEATURE_PAL
-
#define VSASSERT(e, szMsg) \
do { \
if (!(e)) { \
@@ -94,5 +90,4 @@ do { \
#define VsIgnoreAllocs(f)
-#endif // FEATURE_PAL
#endif // __VSASSERT_H__