Tiny IIO Daemon Library

Dependents:  

compat.h

Committer:
mahphalke
Date:
11 months ago
Revision:
2:2119a523fbbc
Parent:
1:6cb62c8c58d6

File content as of revision 2:2119a523fbbc:

/***************************************************************************//**
 *   @file    compat.c
 *   @brief   Tiny IIO Daemon Library global defines
 *   @author  Cristian Pop <cristian.pop@analog.com>
********************************************************************************
 * Copyright (c) 2019, 2020 Analog Devices, Inc.
 *
 * All rights reserved.
 *
 * This software is proprietary to Analog Devices, Inc. and its licensors.
 * By using this software you agree to the terms of the associated
 * Analog Devices Software License Agreement.
*******************************************************************************/

#ifndef COMPAT_H
#define COMPAT_H

#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 _USE_STD_INT_TYPES

#ifdef _USE_STD_INT_TYPES
#include <stddef.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <inttypes.h>
#include <errno.h>
#include <string.h>
typedef int ssize_t;
#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 PRIi32		"li"
# define PRIx32		"x"
# define PRIu16		"u"
#endif //_USE_STD_INT_TYPES

#endif /* COMPAT_H */