Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
0002 /*
0003  * Standard definitions and types for NOLIBC
0004  * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
0005  */
0006 
0007 #ifndef _NOLIBC_STD_H
0008 #define _NOLIBC_STD_H
0009 
0010 /* Declare a few quite common macros and types that usually are in stdlib.h,
0011  * stdint.h, ctype.h, unistd.h and a few other common locations. Please place
0012  * integer type definitions and generic macros here, but avoid OS-specific and
0013  * syscall-specific stuff, as this file is expected to be included very early.
0014  */
0015 
0016 /* note: may already be defined */
0017 #ifndef NULL
0018 #define NULL ((void *)0)
0019 #endif
0020 
0021 /* stdint types */
0022 typedef unsigned char       uint8_t;
0023 typedef   signed char        int8_t;
0024 typedef unsigned short     uint16_t;
0025 typedef   signed short      int16_t;
0026 typedef unsigned int       uint32_t;
0027 typedef   signed int        int32_t;
0028 typedef unsigned long long uint64_t;
0029 typedef   signed long long  int64_t;
0030 typedef unsigned long        size_t;
0031 typedef   signed long       ssize_t;
0032 typedef unsigned long     uintptr_t;
0033 typedef   signed long      intptr_t;
0034 typedef   signed long     ptrdiff_t;
0035 
0036 /* those are commonly provided by sys/types.h */
0037 typedef unsigned int          dev_t;
0038 typedef unsigned long         ino_t;
0039 typedef unsigned int         mode_t;
0040 typedef   signed int          pid_t;
0041 typedef unsigned int          uid_t;
0042 typedef unsigned int          gid_t;
0043 typedef unsigned long       nlink_t;
0044 typedef   signed long         off_t;
0045 typedef   signed long     blksize_t;
0046 typedef   signed long      blkcnt_t;
0047 typedef   signed long        time_t;
0048 
0049 #endif /* _NOLIBC_STD_H */