remove types

This commit is contained in:
bumbread 2022-08-04 20:00:01 +11:00
parent ebcd9fe0de
commit e4f23026f3
9 changed files with 68 additions and 36 deletions

View File

@ -68,5 +68,19 @@
#define WINT_MAX INT_MAX #define WINT_MAX INT_MAX
#define WCHAR_WIDTH USHORT_WIDTH #define WCHAR_WIDTH USHORT_WIDTH
#define WCHAR_MIN USHORT_WIDTH
#define WCHAR_MAX USHORT_WIDTH #if !defined(WCHAR_MIN)
#if defined(_WIN32)
#define WCHAR_MIN 0
#else
#define WCHAR_MIN INT_MIN
#endif
#endif
#if !defined(WCHAR_MAX)
#if defined(_WIN32)
#define WCHAR_MAX USHORT_MAX
#else
#define WCHAR_MAX INT_MAX
#endif
#endif

View File

@ -1,23 +1,19 @@
#pragma once #pragma once
#include <types/size.h>
#define __bool_true_false_are_defined 1 #define __bool_true_false_are_defined 1
#define __alignas_is_defined 1 #define __alignas_is_defined 1
#define __alignof_is_defined 1 #define __alignof_is_defined 1
#define NULL ((void *)0) #if !defined(NULL)
#define offsetof(st, m) ((size_t)((char *)&((st *)0)->m - (char *)0)) #define NULL ((void *)0)
#endif
typedef long long ptrdiff_t;
typedef long long max_align_t;
typedef unsigned short wchar_t; //
#define bool _Bool #define bool _Bool
#define true 1 #define true 1
#define false 0 #define false 0
#define offsetof(st, m) ((size_t)((char *)&((st *)0)->m - (char *)0))
#define alignas _Alignas #define alignas _Alignas
#define alignof _Alignof #define alignof _Alignof
@ -26,3 +22,16 @@ typedef unsigned short wchar_t; //
#else #else
#define noreturn declspec(noreturn) #define noreturn declspec(noreturn)
#endif #endif
#if defined(_WIN32)
typedef long long ptrdiff_t;
typedef unsigned long long size_t;
typedef unsigned long long max_align_t;
typedef unsigned short wchar_t;
#else
typedef long ptrdiff_t;
typedef unsigned long size_t;
typedef unsigned long max_align_t;
typedef int wchar_t;
#endif

View File

@ -10,8 +10,6 @@
#endif #endif
#endif #endif
#include <types/size.h>
#if !defined(NULL) #if !defined(NULL)
#define NULL ((void *)0) #define NULL ((void *)0)
#endif #endif
@ -19,6 +17,12 @@
#define EXIT_SUCCESS 0 #define EXIT_SUCCESS 0
#define EXIT_FAILURE 1 #define EXIT_FAILURE 1
#if defined(_WIN32)
typedef unsigned long long size_t;
#else
typedef unsigned long size_t;
#endif
typedef struct div_t { typedef struct div_t {
int quot; int quot;
int rem; int rem;

View File

@ -1,11 +0,0 @@
#pragma once
typedef struct mbstate_t mbstate_t;
struct mbstate_t {
union {
unsigned short leftover;
unsigned short high_surrogate;
};
};

View File

@ -1,8 +0,0 @@
#pragma once
#if defined(_MSC_VER)
typedef unsigned long long size_t;
#else
typedef unsigned long size_t;
#endif

View File

@ -1,2 +0,0 @@

View File

@ -1,11 +1,20 @@
#pragma once #pragma once
#include <types/mbstate.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#if !defined(_mbstate_t_defined)
#define _mbstate_t_defined
typedef struct mbstate_t mbstate_t;
struct mbstate_t {
union {
unsigned short leftover;
unsigned short high_surrogate;
};
};
#endif
typedef uint_least16_t char16_t; typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t; typedef uint_least32_t char32_t;

View File

@ -1,18 +1,35 @@
#pragma once #pragma once
#include <types/mbstate.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <limits.h> #include <limits.h>
#if defined(_WIN32)
typedef unsigned short wchar_t;
#else
typedef int wchar_t;
#endif
typedef int wint_t; typedef int wint_t;
#if !defined(_mbstate_t_defined)
#define _mbstate_t_defined
typedef struct mbstate_t mbstate_t;
struct mbstate_t {
union {
unsigned short leftover;
unsigned short high_surrogate;
};
};
#endif
// #define WCHAR_MIN 0x0000 // #define WCHAR_MIN 0x0000
// #define WCHAR_MAX 0xffff // #define WCHAR_MAX 0xffff
#ifndef WEOF #ifndef WEOF
#define WEOF -1 #define WEOF -1
#endif #endif