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
22
23/*============================ INCLUDES ======================================*/
24
25#include <stdint.h>
26
27#if !defined(__USE_LOCAL_STDBOOL__)
28# if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) && !defined(__cplusplus)
29# if !defined(bool)
30typedef enum {
31 false = 0,
32 true = !false,
33} bool;
34# endif
35# else
36# include <stdbool.h>
37# endif
38#else
39# undef __USE_LOCAL_STDINT_STDBOOL__
40#endif
41
42#if !__IS_COMPILER_GCC__ && !__IS_COMPILER_LLVM__
43# include <uchar.h>
44#endif
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50/*============================ MACROS ========================================*/
51
52#define __optimal_bit_sz (sizeof(uintalu_t) * 8)
53#define __optimal_bit_msk (__optimal_bit_sz - 1)
54
55/*============================ MACROFIED FUNCTIONS ===========================*/
56/*============================ TYPES =========================================*/
57
58#if defined(__VSF64__)
59typedef uint64_t uintalu_t;
60typedef int64_t intalu_t;
61#elif defined(__VSF16__)
62typedef uint16_t uintalu_t;
63typedef int16_t intalu_t;
64#elif defined(__VSF8__)
65typedef uint8_t uintalu_t;
66typedef int8_t intalu_t;
67#else
70#endif
71
72/*============================ GLOBAL VARIABLES ==============================*/
73/*============================ LOCAL VARIABLES ===============================*/
74/*============================ PROTOTYPES ====================================*/
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif // __APP_TYPE_H_INCLUDED__
81
82/*============================ Multiple-Entry ================================*/
83#include "../__common/__type.h"
int32_t intalu_t
Definition type.h:69
uint32_t uintalu_t
Definition type.h:68
bool
Definition type.h:30
unsigned short uint16_t
Definition stdint.h:7
unsigned uint32_t
Definition stdint.h:9
int int32_t
Definition stdint.h:8
long long int64_t
Definition stdint.h:10
short int16_t
Definition stdint.h:6
unsigned long long uint64_t
Definition stdint.h:11
unsigned char uint8_t
Definition stdint.h:5
signed char int8_t
Definition stdint.h:4