Skip to content
Snippets Groups Projects
Commit f539f306 authored by Ludwig Knüpfer's avatar Ludwig Knüpfer
Browse files

Merge pull request #1698 from Kijewski/ssize_t-for-all

core: Provide ssize_t in a common place
parents 5a8e4492 4e50d742
No related branches found
No related tags found
No related merge requests found
include $(RIOTBOARD)/$(BOARD)/Makefile.dep include $(RIOTBOARD)/$(BOARD)/Makefile.dep
export NATIVEINCLUDES = -I$(RIOTBOARD)/$(BOARD)/include/ export NATIVEINCLUDES += -DNATIVE_INCLUDES
export NATIVEINCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/
export NATIVEINCLUDES += -I$(RIOTBASE)/core/include/ export NATIVEINCLUDES += -I$(RIOTBASE)/core/include/
export NATIVEINCLUDES += -I$(RIOTBASE)/drivers/include/ export NATIVEINCLUDES += -I$(RIOTBASE)/drivers/include/
......
...@@ -11,6 +11,24 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment