summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-01-08 08:25:46 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-01-08 08:25:46 -0600
commit5f5b6293926e29c6c2101f8921c808333260b9b9 (patch)
tree9aac843bd462cceff3c7c22ffff80a67ac959a1a /nuttx
parentb4349d2076c490098375c65996d58139870512b8 (diff)
downloadnuttx-5f5b6293926e29c6c2101f8921c808333260b9b9.tar.gz
nuttx-5f5b6293926e29c6c2101f8921c808333260b9b9.tar.bz2
nuttx-5f5b6293926e29c6c2101f8921c808333260b9b9.zip
Fix some of the SIZE_MAX definitions updated in a recent commit
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/include/limits.h16
-rw-r--r--nuttx/include/stdint.h14
-rw-r--r--nuttx/include/sys/types.h12
3 files changed, 24 insertions, 18 deletions
diff --git a/nuttx/include/limits.h b/nuttx/include/limits.h
index 056e2ada8..4d959d153 100644
--- a/nuttx/include/limits.h
+++ b/nuttx/include/limits.h
@@ -123,11 +123,22 @@
#define _POSIX_OPEN_MAX CONFIG_NFILE_DESCRIPTORS
#define _POSIX_PATH_MAX CONFIG_PATH_MAX
#define _POSIX_PIPE_BUF 512
-#define _POSIX_SSIZE_MAX INT_MAX
#define _POSIX_STREAM_MAX CONFIG_NFILE_STREAMS
#define _POSIX_TZNAME_MAX 3
-/* Requred for sigqueue */
+#ifdef CONFIG_SMALL_MEMORY
+
+#define _POSIX_SSIZE_MAX 32767 /* See sys/types.h */
+#define _POSIX_SSIZE_MIN -32768
+
+#else /* CONFIG_SMALL_MEMORY */
+
+#define _POSIX_SSIZE_MAX 2147483647 /* See sys/types.h */
+#define _POSIX_SSIZE_MIN -2147483648
+
+#endif /* CONFIG_SMALL_MEMORY */
+
+/* Required for sigqueue */
#define _POSIX_RTSIG_MAX 31
#define _POSIX_SIGQUEUE_MAX 32
@@ -184,6 +195,7 @@
#define PATH_MAX _POSIX_PATH_MAX
#define PIPE_BUF _POSIX_PIPE_BUF
#define SSIZE_MAX _POSIX_SSIZE_MAX
+#define SSIZE_MIN _POSIX_SSIZE_MIN
#define STREAM_MAX _POSIX_STREAM_MAX
#define TZNAME_MAX _POSIX_TZNAME_MAX
diff --git a/nuttx/include/stdint.h b/nuttx/include/stdint.h
index 4c14d935e..49e852258 100644
--- a/nuttx/include/stdint.h
+++ b/nuttx/include/stdint.h
@@ -185,10 +185,16 @@
#endif
#ifdef CONFIG_SMALL_MEMORY
-# define SIZE_MAX 0xffff
-#else
-# define SIZE_MAX 0xffffffff
-#endif
+
+#define SIZE_MAX UINT16_MAX /* See sys/types.h */
+#define RSIZE_MAX UINT16_MAX
+
+#else /* CONFIG_SMALL_MEMORY */
+
+#define SIZE_MAX UINT32_MAX /* See sys/types.h */
+#define RSIZE_MAX UINT32_MAX
+
+#endif /* CONFIG_SMALL_MEMORY */
#if 0
# define WCHAR_MIN
diff --git a/nuttx/include/sys/types.h b/nuttx/include/sys/types.h
index 7b579744a..0fa01c117 100644
--- a/nuttx/include/sys/types.h
+++ b/nuttx/include/sys/types.h
@@ -133,26 +133,14 @@ typedef unsigned int mode_t;
#ifdef CONFIG_SMALL_MEMORY
-#define SIZE_MAX UINT16_MAX
typedef uint16_t size_t;
-
-#define SSIZE_MAX INT16_MAX
-#define SSIZE_MIN INT16_MIN
typedef int16_t ssize_t;
-
-#define RSIZE_MAX UINT16_MAX
typedef uint16_t rsize_t;
#else /* CONFIG_SMALL_MEMORY */
-#define SIZE_MAX UINT32_MAX
typedef uint32_t size_t;
-
-#define SSIZE_MAX INT32_MAX
-#define SSIZE_MIN INT32_MIN
typedef int32_t ssize_t;
-
-#define RSIZE_MAX UINT32_MAX
typedef uint32_t rsize_t;
#endif /* CONFIG_SMALL_MEMORY */