Tiny IIO Daemon Library

Dependents:  

Committer:
mahphalke
Date:
Wed Oct 07 15:36:37 2020 +0530
Revision:
2:2119a523fbbc
Parent:
1:6cb62c8c58d6
Added dual license support (LGPL and ADI-BSD)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mahphalke 1:6cb62c8c58d6 1 /***************************************************************************//**
mahphalke 1:6cb62c8c58d6 2 * @file compat.c
mahphalke 1:6cb62c8c58d6 3 * @brief Tiny IIO Daemon Library global defines
mahphalke 1:6cb62c8c58d6 4 * @author Cristian Pop <cristian.pop@analog.com>
mahphalke 1:6cb62c8c58d6 5 ********************************************************************************
mahphalke 1:6cb62c8c58d6 6 * Copyright (c) 2019, 2020 Analog Devices, Inc.
mahphalke 1:6cb62c8c58d6 7 *
mahphalke 1:6cb62c8c58d6 8 * All rights reserved.
mahphalke 1:6cb62c8c58d6 9 *
mahphalke 1:6cb62c8c58d6 10 * This software is proprietary to Analog Devices, Inc. and its licensors.
mahphalke 1:6cb62c8c58d6 11 * By using this software you agree to the terms of the associated
mahphalke 1:6cb62c8c58d6 12 * Analog Devices Software License Agreement.
mahphalke 1:6cb62c8c58d6 13 *******************************************************************************/
mahphalke 1:6cb62c8c58d6 14
mahphalke 1:6cb62c8c58d6 15 #ifndef COMPAT_H
mahphalke 1:6cb62c8c58d6 16 #define COMPAT_H
mahphalke 1:6cb62c8c58d6 17
mahphalke 1:6cb62c8c58d6 18 #define ENOENT 2 /* No such file or directory */
mahphalke 1:6cb62c8c58d6 19 #define EIO 5 /* I/O error */
mahphalke 1:6cb62c8c58d6 20 #define ENODEV 19 /* No such device */
mahphalke 1:6cb62c8c58d6 21 #define EINVAL 22 /* Invalid argument */
mahphalke 1:6cb62c8c58d6 22 #define ENOSYS 38 /* Function not implemented */
mahphalke 1:6cb62c8c58d6 23
mahphalke 1:6cb62c8c58d6 24 #define _USE_STD_INT_TYPES
mahphalke 1:6cb62c8c58d6 25
mahphalke 1:6cb62c8c58d6 26 #ifdef _USE_STD_INT_TYPES
mahphalke 1:6cb62c8c58d6 27 #include <stddef.h>
mahphalke 1:6cb62c8c58d6 28 #include <stdint.h>
mahphalke 1:6cb62c8c58d6 29 #include <inttypes.h>
mahphalke 1:6cb62c8c58d6 30 #include <stdlib.h>
mahphalke 1:6cb62c8c58d6 31 #include <stdbool.h>
mahphalke 1:6cb62c8c58d6 32 #include <stdio.h>
mahphalke 1:6cb62c8c58d6 33 #include <inttypes.h>
mahphalke 1:6cb62c8c58d6 34 #include <errno.h>
mahphalke 1:6cb62c8c58d6 35 #include <string.h>
mahphalke 1:6cb62c8c58d6 36 typedef int ssize_t;
mahphalke 1:6cb62c8c58d6 37 #else // _USE_STD_INT_TYPES
mahphalke 1:6cb62c8c58d6 38 #if !defined(__ssize_t_defined) && !defined(_SSIZE_T_DEFINED)
mahphalke 1:6cb62c8c58d6 39 typedef long int ssize_t;
mahphalke 1:6cb62c8c58d6 40 typedef unsigned long int size_t;
mahphalke 1:6cb62c8c58d6 41 #define __ssize_t_defined
mahphalke 1:6cb62c8c58d6 42 #define _SSIZE_T_DEFINED
mahphalke 1:6cb62c8c58d6 43 #endif
mahphalke 1:6cb62c8c58d6 44
mahphalke 1:6cb62c8c58d6 45 typedef long int32_t;
mahphalke 1:6cb62c8c58d6 46 typedef unsigned long uint32_t;
mahphalke 1:6cb62c8c58d6 47 typedef int bool;
mahphalke 1:6cb62c8c58d6 48
mahphalke 1:6cb62c8c58d6 49 #define true 1
mahphalke 1:6cb62c8c58d6 50 #define false 0
mahphalke 1:6cb62c8c58d6 51
mahphalke 1:6cb62c8c58d6 52 #define NULL (void*)0
mahphalke 1:6cb62c8c58d6 53
mahphalke 1:6cb62c8c58d6 54 #define PRIi32 "li"
mahphalke 1:6cb62c8c58d6 55 # define PRIx32 "x"
mahphalke 1:6cb62c8c58d6 56 # define PRIu16 "u"
mahphalke 1:6cb62c8c58d6 57 #endif //_USE_STD_INT_TYPES
mahphalke 1:6cb62c8c58d6 58
mahphalke 1:6cb62c8c58d6 59 #endif /* COMPAT_H */