VSF Documented
type.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __APP_TYPE_H_INCLUDED__
19#define __APP_TYPE_H_INCLUDED__
20
21/*============================ INCLUDES ======================================*/
22
23#if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) && !defined(__cplusplus)
24typedef unsigned char uint8_t;
25typedef signed char int8_t;
26typedef unsigned int uint_fast8_t;
27typedef signed int int_fast8_t;
28
29typedef unsigned short uint16_t;
30typedef signed short int16_t;
31typedef unsigned int uint_fast16_t;
32typedef signed int int_fast16_t;
33
34typedef unsigned int uint32_t;
35typedef signed int int32_t;
36typedef unsigned int uint_fast32_t;
37typedef signed int int_fast32_t;
38
39typedef unsigned long long uint64_t;
40typedef signed long long int64_t;
41typedef unsigned long long uint_fast64_t;
42typedef signed long long int_fast64_t;
43
44#ifndef UINT64_MAX
45# define UINT64_MAX ((uint64_t)(-1))
46#endif
47
52#else
53# include <stdint.h>
54#endif
55
56#if !defined(__USE_LOCAL_STDBOOL__)
57# if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) && !defined(__cplusplus)
58# if !defined(bool)
59typedef enum {
60 false = 0,
61 true = !false,
62} bool;
63# endif
64# else
65# include <stdbool.h>
66# endif
67#else
68# undef __USE_LOCAL_STDINT_STDBOOL__
69#endif
70
71#if !__IS_COMPILER_GCC__ && !__IS_COMPILER_LLVM__
72# include <uchar.h>
73#endif
74
75#ifdef __cplusplus
76extern "C" {
77#endif
78
79/*============================ MACROS ========================================*/
80
81#define __optimal_bit_sz (sizeof(uintalu_t) * 8)
82#define __optimal_bit_msk (__optimal_bit_sz - 1)
83
84/*============================ MACROFIED FUNCTIONS ===========================*/
85/*============================ TYPES =========================================*/
86
89
90/*============================ GLOBAL VARIABLES ==============================*/
91/*============================ LOCAL VARIABLES ===============================*/
92/*============================ PROTOTYPES ====================================*/
93
94#ifdef __cplusplus
95}
96#endif
97
98#endif // __APP_TYPE_H_INCLUDED__
99
100
101/*============================ Multiple-Entry ================================*/
102#include "../__common/__type.h"
103
104#if __IS_COMPILER_GCC__
105
106#ifndef __VSF_APPLET__
107
108// gcc use __builtin_alloca
109# ifndef alloca
110# define alloca(__size) __builtin_alloca(__size)
111# endif
112
113// gcc has no strcasestr
114#ifdef __cplusplus
115extern "C" {
116#endif
117extern char * strcasestr(const char *str, const char *substr);
118#ifdef __cplusplus
119}
120#endif
121
122#endif // __VSF_APPLET__
123
124#endif
int64_t intmax_t
Definition type.h:52
uint32_t uintptr_t
Definition type.h:49
unsigned int uint_fast16_t
Definition type.h:32
signed short int16_t
Definition type.h:31
unsigned short uint16_t
Definition type.h:30
signed long long int_fast64_t
Definition type.h:43
uint64_t uintmax_t
Definition type.h:51
signed int int_fast8_t
Definition type.h:28
unsigned int uint32_t
Definition type.h:35
int32_t intptr_t
Definition type.h:50
unsigned int uint_fast32_t
Definition type.h:37
signed int int_fast16_t
Definition type.h:33
unsigned long long uint64_t
Definition type.h:40
unsigned long long uint_fast64_t
Definition type.h:42
signed int int32_t
Definition type.h:36
unsigned char uint8_t
Definition type.h:25
unsigned int uint_fast8_t
Definition type.h:27
signed long long int64_t
Definition type.h:41
signed int int_fast32_t
Definition type.h:38
signed char int8_t
Definition type.h:26
int32_t intalu_t
Definition type.h:69
uint32_t uintalu_t
Definition type.h:68
bool
Definition type.h:30
unsigned char uint_fast8_t
Definition stdint.h:23
unsigned uint32_t
Definition stdint.h:9
int int32_t
Definition stdint.h:8
long long int64_t
Definition stdint.h:10
unsigned long long uint64_t
Definition stdint.h:11
char int_fast8_t
Definition stdint.h:22
char * strcasestr(const char *haystack, const char *needle)