[CRT] Fix CRT headers a bit

* Remove unused internal version of float.h
* Define _STATIC_ASSERT in crtdefs.h
* Add some missing declarations
This commit is contained in:
Timo Kreuzer 2021-07-28 10:25:22 +02:00
parent 0f3d052af9
commit b05cc36208
9 changed files with 28 additions and 189 deletions

View file

@ -81,11 +81,6 @@ extern "C" {
size_t lTotalCount;
} _CrtMemState;
#ifndef _STATIC_ASSERT
#define _STATIC_ASSERT(expr) extern char (*static_assert(void)) [(expr) ? 1 : -1]
#endif
// Debug reporting functions
#ifdef _DEBUG

View file

@ -182,6 +182,15 @@
#define __crt_typefix(ctype)
#ifndef _STATIC_ASSERT
#ifdef __cplusplus
#define _STATIC_ASSERT(expr) static_assert((expr), #expr)
#elif defined(__clang__) || defined(__GNUC__)
#define _STATIC_ASSERT(expr) _Static_assert((expr), #expr)
#else
#define _STATIC_ASSERT(expr) extern char (*__static_assert__(void)) [(expr) ? 1 : -1]
#endif
#endif /* _STATIC_ASSERT */
/** Deprecated ***************************************************************/

View file

@ -22,7 +22,7 @@ typedef union _DECLSPEC_INTRIN_TYPE _CRT_ALIGN(16) __m128i
unsigned __int32 m128i_u32[4];
unsigned __int64 m128i_u64[2];
} __m128i;
C_ASSERT(sizeof(__m128i) == 16);
_STATIC_ASSERT(sizeof(__m128i) == 16);
typedef struct _DECLSPEC_INTRIN_TYPE _CRT_ALIGN(16) __m128d
{

View file

@ -113,6 +113,16 @@ extern "C" {
__free_locale(
_In_opt_ _locale_t _Locale);
_CRTIMP
unsigned int
__cdecl
___lc_collate_cp_func(void);
_CRTIMP
unsigned int
__cdecl
___lc_codepage_func(void);
#ifndef _WLOCALE_DEFINED
#define _WLOCALE_DEFINED
_Check_return_opt_

View file

@ -24,10 +24,6 @@ extern "C" {
#define _HEAP_MAXREQ 0xFFFFFFE0
#endif
#ifndef _STATIC_ASSERT
#define _STATIC_ASSERT(expr) extern char (*static_assert(void)) [(expr) ? 1 : -1]
#endif
/* Return codes for _heapwalk() */
#define _HEAPEMPTY (-1)
#define _HEAPOK (-2)

View file

@ -114,6 +114,13 @@ extern "C" {
#endif
#if defined(_M_IX86) // newer Windows versions always have it
_CRTIMP int* __cdecl __p__commode(void);
#endif
/* On newer Windows windows versions, (*__p__commode()) is used */
extern _CRTIMP int _commode;
#define _IOREAD 0x0001
#define _IOWRT 0x0002