-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcompat.h
66 lines (57 loc) · 1.7 KB
/
compat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* libtinyiiod - Tiny IIO Daemon Library
*
* Copyright (C) 2019 Analog Devices, Inc.
* Author: Cristian Pop <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#ifndef COMPAT_H
#define COMPAT_H
#ifdef _USE_STD_INT_TYPES
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <inttypes.h>
#include <errno.h>
#include <string.h>
#if defined(_WIN32) || defined(__ARMCC_VERSION) || defined(__IAR_SYSTEMS_ICC__)
#ifndef _SSIZE_T_DEFINED
#define _SSIZE_T_DEFINED
#undef ssize_t
typedef long int ssize_t;
#endif
#endif
#else // _USE_STD_INT_TYPES
#if !defined(__ssize_t_defined) && !defined(_SSIZE_T_DEFINED)
typedef long int ssize_t;
typedef unsigned long int size_t;
#define __ssize_t_defined
#define _SSIZE_T_DEFINED
#endif
typedef long int32_t;
typedef unsigned long uint32_t;
typedef int bool;
#define true 1
#define false 0
#define NULL (void*)0
#define ENOENT 2 /* No such file or directory */
#define EIO 5 /* I/O error */
#define ENODEV 19 /* No such device */
#define EINVAL 22 /* Invalid argument */
#define ENOSYS 38 /* Function not implemented */
#define PRIi32 "li"
# define PRIx32 "x"
# define PRIu16 "u"
#endif //_USE_STD_INT_TYPES
#endif /* COMPAT_H */