mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-19 11:33:51 +01:00
core: Provide ssize_t in a common place
Now you can include `kernel_types.h` if you need the `ssize_t`, without facing problems due to the terrible MSP toolchain.
This commit is contained in:
parent
866c713a7e
commit
4e50d74272
@ -11,6 +11,24 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
#ifndef NATIVE_INCLUDES
|
||||||
|
# include <stddef.h>
|
||||||
|
# include <sys/types.h>
|
||||||
|
|
||||||
|
# ifndef SSIZE_MAX
|
||||||
|
# ifdef _POSIX_SSIZE_MAX
|
||||||
|
# define SSIZE_MAX _POSIX_SSIZE_MAX
|
||||||
|
# else
|
||||||
|
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined (MODULE_MSP430_COMMON) || defined (MODULE_ATMEGA_COMMON)
|
||||||
|
typedef signed ssize_t;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def MAXTHREADS
|
* @def MAXTHREADS
|
||||||
|
|||||||
@ -10,4 +10,3 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
typedef int16_t suseconds_t;
|
typedef int16_t suseconds_t;
|
||||||
typedef size_t ssize_t;
|
|
||||||
|
|||||||
@ -12,6 +12,9 @@
|
|||||||
#include <sys/_types.h>
|
#include <sys/_types.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
/** defining signed type for size_t */
|
||||||
|
#include "kernel_types.h"
|
||||||
|
|
||||||
#ifndef EINVAL
|
#ifndef EINVAL
|
||||||
/**
|
/**
|
||||||
* @brief defines EINVAL if MSP430 toolchain is too old to provide it itself
|
* @brief defines EINVAL if MSP430 toolchain is too old to provide it itself
|
||||||
@ -28,9 +31,6 @@
|
|||||||
#define EOVERFLOW (65)
|
#define EOVERFLOW (65)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** defining signed type for size_t */
|
|
||||||
typedef _ssize_t ssize_t;
|
|
||||||
|
|
||||||
typedef unsigned long time_t;
|
typedef unsigned long time_t;
|
||||||
|
|
||||||
struct timespec {
|
struct timespec {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user